Skip to content

Commit 85d7e47

Browse files
Another create call substitution
1 parent 6e48aad commit 85d7e47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/board/audio/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ class BufferedAudio {
192192
}
193193

194194
writeData(buffer: AudioBuffer) {
195-
const source = new AudioBufferSourceNode(this.context, {
196-
buffer,
197-
});
195+
// Use createBufferSource instead of new AudioBufferSourceNode to support Safari 14.0.
196+
const source = this.context.createBufferSource();
197+
source.buffer = buffer;
198198
source.onended = this.callback;
199199
source.connect(this.destination);
200200
const currentTime = this.context.currentTime;

0 commit comments

Comments
 (0)