Skip to content

Commit

Permalink
Another create call substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Feb 19, 2024
1 parent 6e48aad commit 85d7e47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/board/audio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 85d7e47

Please sign in to comment.