Browse Source

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.
Florian Meißner 10 years ago
parent
commit
2af4eaedf2
  1. 2
      Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp
  2. 2
      Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp

2
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;

2
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);

Loading…
Cancel
Save