mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-01-08 13:51:58 -05:00
Use native audio buffer source node
Instead of the Tone js wrapper for it, because a recent update to Tone changed the ‘onended’ callback in a way that broke our “play sound until done” block.
This commit is contained in:
parent
ea3c4a47f2
commit
e8864387c6
1 changed files with 2 additions and 1 deletions
|
@ -60,7 +60,8 @@ class SoundPlayer {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bufferSource = new Tone.BufferSource(this.buffer.get());
|
this.bufferSource = Tone.context.createBufferSource();
|
||||||
|
this.bufferSource.buffer = this.buffer.get();
|
||||||
this.bufferSource.playbackRate.value = this.playbackRate;
|
this.bufferSource.playbackRate.value = this.playbackRate;
|
||||||
this.bufferSource.connect(this.outputNode);
|
this.bufferSource.connect(this.outputNode);
|
||||||
this.bufferSource.start();
|
this.bufferSource.start();
|
||||||
|
|
Loading…
Reference in a new issue