Improve getOscillator/noiseMix release

This commit is contained in:
jeromew 2025-12-08 17:31:34 +00:00
parent 1225d04437
commit 71d36b79ed
3 changed files with 13 additions and 6 deletions

View file

@ -283,9 +283,12 @@ export function drywet(dry, wet, wetAmount = 0) {
wet_gain.connect(mix);
return {
node: mix,
onended: () => {
dry_gain.disconnect(mix);
wet_gain.disconnect(mix);
teardown: () => {
releaseAudioNode(dry_gain);
releaseAudioNode(wet_gain);
// it is not the responsability of drywet
// to call `releaseAudioNode` on
// the 2 external args dry and wet
dry.disconnect(dry_gain);
wet.disconnect(wet_gain);
},