mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
Fixed significant distortion of sound effects with FMOD Studio API
This commit is contained in:
parent
01b1efe9ee
commit
a2a1d2a36d
1 changed files with 11 additions and 0 deletions
|
@ -2758,6 +2758,16 @@ std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int l
|
||||||
exinfo.defaultfrequency = frequency;
|
exinfo.defaultfrequency = frequency;
|
||||||
switch (bits)
|
switch (bits)
|
||||||
{
|
{
|
||||||
|
#if FMOD_STUDIO
|
||||||
|
case -8:
|
||||||
|
// Need to convert sample data from signed to unsigned.
|
||||||
|
for (int i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
sfxdata[i] ^= 0x80;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
#else // !FMOD_STUDIO
|
||||||
case 8:
|
case 8:
|
||||||
// Need to convert sample data from unsigned to signed.
|
// Need to convert sample data from unsigned to signed.
|
||||||
for (int i = 0; i < length; ++i)
|
for (int i = 0; i < length; ++i)
|
||||||
|
@ -2766,6 +2776,7 @@ std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int l
|
||||||
}
|
}
|
||||||
|
|
||||||
case -8:
|
case -8:
|
||||||
|
#endif // FMOD_STUDIO
|
||||||
exinfo.format = FMOD_SOUND_FORMAT_PCM8;
|
exinfo.format = FMOD_SOUND_FORMAT_PCM8;
|
||||||
numsamples = length;
|
numsamples = length;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue