summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-02-13 20:03:06 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-02-13 20:03:06 +0100
commitb64c648bbcc15ee6930569643197a35778f242d9 (patch)
tree0a62c9ec0220e84cf987e9e804e43b9a41ca91f3 /source
parent87988070023a95bb2860ec8b4986e2b2f7316292 (diff)
downloadsaw-b64c648bbcc15ee6930569643197a35778f242d9.zip
Buffer size adjustment for web
Diffstat (limited to 'source')
-rw-r--r--source/saw/main.c9
1 files changed, 8 insertions, 1 deletions
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;