ANDROID/AUDIO: Convert the output buffer size value given to the Mixer from bytes to frame size

This commit is contained in:
Andrea Boscarino 2021-12-19 11:25:52 +01:00 committed by Le Philousophe
parent a160058d06
commit 2c84382525

View File

@ -464,7 +464,10 @@ void OSystem_Android::initBackend() {
gettimeofday(&_startTime, 0);
_mixer = new Audio::MixerImpl(_audio_sample_rate, _audio_buffer_size);
// The division by four happens because the Mixer stores the size in frame units
// instead of bytes; this means that, since we have audio in stereo (2 channels)
// with a word size of 16 bit (2 bytes), we have to divide the effective size by 4.
_mixer = new Audio::MixerImpl(_audio_sample_rate, _audio_buffer_size / 4);
_mixer->setReady(true);
_timer_thread_exit = false;