From 85d7e470fe4c7f396f74bd8d671e5b3a512bcb03 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 19 Feb 2024 16:20:51 +0000 Subject: [PATCH] Another create call substitution --- src/board/audio/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/board/audio/index.ts b/src/board/audio/index.ts index 6fa20297..a8062d98 100644 --- a/src/board/audio/index.ts +++ b/src/board/audio/index.ts @@ -192,9 +192,9 @@ class BufferedAudio { } writeData(buffer: AudioBuffer) { - const source = new AudioBufferSourceNode(this.context, { - buffer, - }); + // Use createBufferSource instead of new AudioBufferSourceNode to support Safari 14.0. + const source = this.context.createBufferSource(); + source.buffer = buffer; source.onended = this.callback; source.connect(this.destination); const currentTime = this.context.currentTime;