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:
@ -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;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user