summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 11:25:05 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 11:25:05 +0100
commit7b55dc55df6c15dc20c21dfab566176a07f6d86f (patch)
tree109c2bd42f552388aa9726fbc5a7e771287de7d9 /tools
parentcf0775046c059fed1a4ed04d500f26397002667d (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/spectral_editor/script.js12
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;
};