Skip to content

Commit

Permalink
emscripten: double the audio buffer size.
Browse files Browse the repository at this point in the history
Some systems seem to not keep up with the smaller buffer.

Reference Issue libsdl-org#11930.
  • Loading branch information
icculus committed Jan 13, 2025
1 parent e10e42c commit 3766a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/emscripten/SDL_emscriptenaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static bool EMSCRIPTENAUDIO_OpenDevice(SDL_AudioDevice *device)

// limit to native freq
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);

Expand Down

0 comments on commit 3766a39

Please sign in to comment.