mirror of https://github.com/libsdl-org/SDL.git
emscripten: double the audio buffer size.
Some systems seem to not keep up with the smaller buffer. Reference Issue #11930.
This commit is contained in:
parent
e10e42c814
commit
3766a39409
|
|
@ -190,7 +190,7 @@ static bool EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)
|
||||||
|
|
||||||
// limit to native freq
|
// limit to native freq
|
||||||
device->spec.freq = EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
device->spec.freq = EM_ASM_INT({ return Module['SDL3'].audioContext.sampleRate; });
|
||||||
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq);
|
device->sample_frames = SDL_GetDefaultSampleFramesFromFreq(device->spec.freq) * 2; // double the buffer size, some browsers need more, and we'll just have to live with the latency.
|
||||||
|
|
||||||
SDL_UpdatedAudioDeviceFormat(device);
|
SDL_UpdatedAudioDeviceFormat(device);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue