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:
Eric Rosenbaum 2017-04-18 18:40:06 -04:00
parent ea3c4a47f2
commit e8864387c6

View file

@ -60,7 +60,8 @@ class SoundPlayer {
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.connect(this.outputNode);
this.bufferSource.start();