From c0f4f4715026d909cf3339e370a3298027f554a7 Mon Sep 17 00:00:00 2001 From: jeromew Date: Mon, 29 Dec 2025 14:04:40 +0000 Subject: [PATCH] Fix AudioContext change detection. Use AudioNode.context --- packages/superdough/superdough.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/superdough/superdough.mjs b/packages/superdough/superdough.mjs index e98a2aa22..1ce91c835 100644 --- a/packages/superdough/superdough.mjs +++ b/packages/superdough/superdough.mjs @@ -359,9 +359,7 @@ export let analysers = {}, analysersData = {}; export function getAnalyserById(id, fftSize = 1024, smoothingTimeConstant = 0.5) { - // below commented out branch is hotfixing https://codeberg.org/uzu/strudel/issues/1847 - // might cause conflicts with exporting... - if (!analysers[id] /* || analysers[id].audioContext != getAudioContext() */) { + if (!analysers[id] || analysers[id].context != getAudioContext()) { // make sure this doesn't happen too often as it piles up garbage const analyserNode = getAudioContext().createAnalyser(); analyserNode.fftSize = fftSize;