1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +00:00

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.
This commit is contained in:
Florian Meißner
2014-10-28 15:44:45 +01:00
parent 7cd8f51eb4
commit 2af4eaedf2
2 changed files with 2 additions and 2 deletions

View File

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

View File

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