use releasenode
This commit is contained in:
parent
7a5020aa71
commit
4476921069
1 changed files with 12 additions and 5 deletions
|
|
@ -419,7 +419,7 @@ class Chain {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
releaseNodes() {
|
releaseNodes() {
|
||||||
this.audioNodes.forEach((n) => (isPoolable(n) ? releaseNodeToPool(n) : n?.disconnect()));
|
this.audioNodes.forEach((n) => (isPoolable(n) ? releaseNodeToPool(n) : releaseAudioNode(n)));
|
||||||
this.audioNodes = [];
|
this.audioNodes = [];
|
||||||
this.tails = [];
|
this.tails = [];
|
||||||
}
|
}
|
||||||
|
|
@ -536,10 +536,17 @@ export const superdough = async (value, t, hapDuration, cps = 0.5, cycle = 0.5)
|
||||||
nodes.main['source'] = [sourceNode];
|
nodes.main['source'] = [sourceNode];
|
||||||
} else if (getSound(s)) {
|
} else if (getSound(s)) {
|
||||||
const { onTrigger } = getSound(s);
|
const { onTrigger } = getSound(s);
|
||||||
const onEnded = () => {
|
|
||||||
chain.releaseNodes();
|
const onEnded = () =>
|
||||||
activeSoundSources.delete(chainID);
|
webAudioTimeout(
|
||||||
};
|
ac,
|
||||||
|
() => {
|
||||||
|
chain.releaseNodes();
|
||||||
|
activeSoundSources.delete(chainID);
|
||||||
|
},
|
||||||
|
0,
|
||||||
|
endWithRelease,
|
||||||
|
);
|
||||||
|
|
||||||
const soundHandle = await onTrigger(t, value, onEnded, cps);
|
const soundHandle = await onTrigger(t, value, onEnded, cps);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue