summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/OpenALStream.cpp
diff options
context:
space:
mode:
authorAdam D. Moss <c@yotes.com>2015-01-18 23:11:45 +0000
committerAdam D. Moss <c@yotes.com>2015-01-19 10:24:44 +0000
commit05d2bf6060e26d3507bbb6f285c452a328101780 (patch)
tree7041dd696a6e307f918c83c03abc82d6bc5b7d4d /Source/Core/AudioCommon/OpenALStream.cpp
parent37a770bb9f23404cbdc75e8cc2df31dfecb97057 (diff)
Audio: Drop the LFE/subwoofer channel from the decoded surround
DPL2Decode still doesn't decode 5.1 properly, leaving bass in all channels, but its 5.0 is pretty good, so leave it at that.
Diffstat (limited to 'Source/Core/AudioCommon/OpenALStream.cpp')
-rw-r--r--Source/Core/AudioCommon/OpenALStream.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/OpenALStream.cpp b/Source/Core/AudioCommon/OpenALStream.cpp
index 0752e54b6c..d56be05672 100644
--- a/Source/Core/AudioCommon/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/OpenALStream.cpp
@@ -251,6 +251,14 @@ void OpenALStream::SoundLoop()
{
float dpl2[OAL_MAX_SAMPLES * OAL_MAX_BUFFERS * SURROUND_CHANNELS];
DPL2Decode(sampleBuffer, nSamples, dpl2);
+ // zero-out the subwoofer channel - DPL2Decode generates a pretty
+ // good 5.0 but not a good 5.1 output. Sadly there is not a 5.0
+ // AL_FORMAT_50CHN32 to make this super-explicit.
+ // DPL2Decode output: LEFTFRONT, RIGHTFRONT, CENTREFRONT, (sub), LEFTREAR, RIGHTREAR
+ for (u32 i=0; i < nSamples; ++i)
+ {
+ dpl2[i*SURROUND_CHANNELS + 3 /*sub/lfe*/] = 0.0f;
+ }
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_51CHN32, dpl2, nSamples * FRAME_SURROUND_FLOAT, ulFrequency);
ALenum err = alGetError();
if (err == AL_INVALID_ENUM)