mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
Properly sum the channels being downmixed to mono
This commit is contained in:
parent
12c9281a7e
commit
c3cef91a4f
1 changed files with 2 additions and 2 deletions
|
@ -1045,7 +1045,7 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int
|
||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for(int c = 0;c < channels;c++)
|
for(int c = 0;c < channels;c++)
|
||||||
sum = ((short*)sfxdata)[i*channels + c];
|
sum += ((short*)sfxdata)[i*channels + c];
|
||||||
((short*)sfxdata)[i] = sum / channels;
|
((short*)sfxdata)[i] = sum / channels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1055,7 +1055,7 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int
|
||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
for(int c = 0;c < channels;c++)
|
for(int c = 0;c < channels;c++)
|
||||||
sum = sfxdata[i*channels + c] - 128;
|
sum += sfxdata[i*channels + c] - 128;
|
||||||
sfxdata[i] = (sum / channels) + 128;
|
sfxdata[i] = (sum / channels) + 128;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue