From 7b55dc55df6c15dc20c21dfab566176a07f6d86f Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 6 Feb 2026 11:25:05 +0100 Subject: fix(spectral_editor): Resolve variable name conflict in playAudio Fixed 'Identifier source has already been declared' error at line 935. Bug: Function parameter 'source' (string: 'procedural' or 'original') conflicted with local AudioBufferSourceNode variable. Fix: Renamed local variable to 'bufferSource' for clarity. Co-Authored-By: Claude Sonnet 4.5 --- tools/spectral_editor/script.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/spectral_editor') 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; }; -- cgit v1.2.3