From b64c648bbcc15ee6930569643197a35778f242d9 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 13 Feb 2024 20:03:06 +0100 Subject: Buffer size adjustment for web --- source/saw/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/saw/main.c b/source/saw/main.c index bdeb420..38d292f 100644 --- a/source/saw/main.c +++ b/source/saw/main.c @@ -57,7 +57,11 @@ enum { CHANNEL_COUNT = 2, SAMPLE_RATE = 44100, - BUFFER_SIZE = 2048, +#ifdef __EMSCRIPTEN__ + BUFFER_SIZE = 2048 * 32, +#else + BUFFER_SIZE = 2048 * 4, +#endif TRACK_COUNT = 16, ROLL_COUNT = 32, @@ -331,6 +335,9 @@ static f64 saw_oscillator(i32 type, f64 frequency, f64 phase, } static void saw_audio_render(void) { + // FIXME + // Improve performance. + if (mtx_lock(&saw_playback_mutex) != thrd_success) { assert(0); return; -- cgit v1.2.3