From b3d6afc1c1436f94c7a1591f9aa156dd49948712 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 4 May 2014 22:04:20 -0400 Subject: [PATCH] Can you say KABOOM? The data is interleaved. If you randomly change it up, OpenAL *will* crash on you... --- Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp | 9 --------- .../Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp | 9 --------- 2 files changed, 18 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp index be84394b..bbcbb006 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp @@ -134,15 +134,6 @@ bool plWin32StaticSound::LoadSound( bool is3D ) } uint32_t bufferSize = buffer->GetDataLength(); - if( header.fNumChannels > 1 && is3D ) - { - // We can only do a single channel of 3D sound. So copy over one (later) - bufferSize /= header.fNumChannels; - header.fBlockAlign /= header.fNumChannels; - header.fAvgBytesPerSec /= header.fNumChannels; - header.fNumChannels = 1; - } - bool tryStatic = true; // If we want FX, we can't use a static voice, but EAX doesn't fit under that limitation :) if( 0 ) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp index dac85d7a..2e8895f4 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp @@ -271,15 +271,6 @@ bool plWin32StreamingSound::LoadSound( bool is3D ) return false; } - if( header.fNumChannels > 1 && is3D ) - { - // We can only do a single channel of 3D sound. So copy over one (later) - bufferSize /= header.fNumChannels; - header.fBlockAlign /= header.fNumChannels; - header.fAvgBytesPerSec /= header.fNumChannels; - header.fNumChannels = 1; - } - // Actually create the buffer now (always looping) fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet(kPropLooping), false, true ); if( !fDSoundBuffer->IsValid() )