diff options
Diffstat (limited to 'tools/spectral_editor')
| -rw-r--r-- | tools/spectral_editor/script.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/spectral_editor/script.js b/tools/spectral_editor/script.js index 1518840..7877012 100644 --- a/tools/spectral_editor/script.js +++ b/tools/spectral_editor/script.js @@ -932,15 +932,15 @@ function playAudio(source) { audioBuffer.getChannelData(0).set(audioData); // Play - const source = state.audioContext.createBufferSource(); - source.buffer = audioBuffer; - source.connect(state.audioContext.destination); - source.start(); + const bufferSource = state.audioContext.createBufferSource(); + bufferSource.buffer = audioBuffer; + bufferSource.connect(state.audioContext.destination); + bufferSource.start(); - state.currentSource = source; + state.currentSource = bufferSource; state.isPlaying = true; - source.onended = () => { + bufferSource.onended = () => { state.isPlaying = false; state.currentSource = null; }; |
