Chromium needs a larger audio buffer (#1300)

* Chromium needs a larger audio buffer: https://github.com/dr-soft/miniaudio/issues/150

* changed PLATFORM_WEB to __EMSCRIPTEN__
This commit is contained in:
Random 2020-07-10 03:34:35 -07:00 committed by GitHub
parent b4ff6fdde3
commit 86a8f1d5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -419,6 +419,9 @@ void InitAudioDevice(void)
config.sampleRate = AUDIO_DEVICE_SAMPLE_RATE;
config.dataCallback = OnSendAudioDataToDevice;
config.pUserData = NULL;
#if defined(__EMSCRIPTEN__)
config.periodSizeInMilliseconds = 33;
#endif
result = ma_device_init(&AUDIO.System.context, &config, &AUDIO.System.device);
if (result != MA_SUCCESS)