[perf] fix connect leak when .noise() is in the mix

This commit is contained in:
jeromew 2025-11-16 09:23:11 +00:00
parent dd2c808cd7
commit d9f63b8dfa
3 changed files with 28 additions and 12 deletions

View file

@ -65,8 +65,9 @@ export function getNoiseOscillator(type = 'white', t, density = 0.02) {
export function getNoiseMix(inputNode, wet, t) {
const noiseOscillator = getNoiseOscillator('pink', t);
const noiseMix = drywet(inputNode, noiseOscillator.node, wet);
noiseOscillator.node.onended = () => noiseMix.onended();
return {
node: noiseMix,
node: noiseMix.node,
stop: (time) => noiseOscillator?.stop(time),
};
}