From d6c3d77a3880d4807dc7f3fa61d640143ef351e6 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 8 Apr 2012 04:57:59 +0000 Subject: [PATCH] - 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) --- src/sound/fmodsound.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index 8236ca9af..21ba53b5b 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -1772,17 +1772,6 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener * ((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) { result = chan->getMode(&mode); @@ -1807,6 +1796,19 @@ FISoundChannel *FMODSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener * chan->setMode(mode); 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) { chan->setFrequency(freq);