From 2af4eaedf2247c8bef5a23d5d9d59cb831db05df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Mei=C3=9Fner?= Date: Tue, 28 Oct 2014 15:44:45 +0100 Subject: [PATCH] Calculate block alignment properly *sigh* This happens when you copy the formula from somewhere else... Let's do it correctly now and fix the source in plVoiceChat as well. --- Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp | 2 +- Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp b/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp index 59cd6eb8..73d0d5ff 100644 --- a/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp +++ b/Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp @@ -374,7 +374,7 @@ bool plMoviePlayer::Start() header.fNumChannels = audio->GetChannels(); header.fBitsPerSample = audio->GetBitDepth() == 8 ? 8 : 16; header.fNumSamplesPerSec = 48000; // OPUS specs say we shall always decode at 48kHz - header.fBlockAlign = header.fNumChannels * header.fBitsPerSample / 2; + header.fBlockAlign = header.fNumChannels * header.fBitsPerSample / 8; header.fAvgBytesPerSec = header.fNumSamplesPerSec * header.fBlockAlign; fAudioSound.reset(new plWin32VideoSound(header)); int error; diff --git a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp index efb86ff3..c5fc65a1 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp @@ -435,7 +435,7 @@ bool plVoiceSound::LoadSound( bool is3D ) header.fBitsPerSample = 16; header.fNumChannels = 1; header.fNumSamplesPerSec = FREQUENCY; - header.fBlockAlign = header.fNumChannels * header.fBitsPerSample / 2; + header.fBlockAlign = header.fNumChannels * header.fBitsPerSample / 8; header.fAvgBytesPerSec = header.fNumSamplesPerSec * header.fBlockAlign; fDSoundBuffer = new plDSoundBuffer(0, header, true, false, false, true);