mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
- Fixed: Stereo sound volume reduction should only be done for stereo sounds played in 3D. Head-
relative ones should remain full volume. SVN r3540 (trunk)
This commit is contained in:
parent
1e63d07f1b
commit
d6c3d77a38
1 changed files with 13 additions and 11 deletions
|
@ -1772,17 +1772,6 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *
|
||||||
((FMOD::Sound *)sfx.data)->setDefaults(def_freq, def_vol, def_pan, def_priority);
|
((FMOD::Sound *)sfx.data)->setDefaults(def_freq, def_vol, def_pan, def_priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce volume of stereo sounds, because each channel will be summed together
|
|
||||||
// and is likely to be very similar, resulting in an amplitude twice what it
|
|
||||||
// would have been had it been mixed to mono.
|
|
||||||
if (FMOD_OK == ((FMOD::Sound *)sfx.data)->getFormat(NULL, NULL, &numchans, NULL))
|
|
||||||
{
|
|
||||||
if (numchans > 1)
|
|
||||||
{
|
|
||||||
vol *= 0.5f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FMOD_OK == result)
|
if (FMOD_OK == result)
|
||||||
{
|
{
|
||||||
result = chan->getMode(&mode);
|
result = chan->getMode(&mode);
|
||||||
|
@ -1807,6 +1796,19 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener *
|
||||||
chan->setMode(mode);
|
chan->setMode(mode);
|
||||||
chan->setChannelGroup((flags & SNDF_NOPAUSE) ? SfxGroup : PausableSfx);
|
chan->setChannelGroup((flags & SNDF_NOPAUSE) ? SfxGroup : PausableSfx);
|
||||||
|
|
||||||
|
if (mode & FMOD_3D)
|
||||||
|
{
|
||||||
|
// Reduce volume of stereo sounds, because each channel will be summed together
|
||||||
|
// and is likely to be very similar, resulting in an amplitude twice what it
|
||||||
|
// would have been had it been mixed to mono.
|
||||||
|
if (FMOD_OK == ((FMOD::Sound *)sfx.data)->getFormat(NULL, NULL, &numchans, NULL))
|
||||||
|
{
|
||||||
|
if (numchans > 1)
|
||||||
|
{
|
||||||
|
vol *= 0.5f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (freq != 0)
|
if (freq != 0)
|
||||||
{
|
{
|
||||||
chan->setFrequency(freq);
|
chan->setFrequency(freq);
|
||||||
|
|
Loading…
Reference in a new issue