I'm working on some sound effect with delay which I have created using delayNode and a feedback loop. However this seems to be infinite loop and after some time (pretty quick) audio starts to lag and then stops completely with a crunch.
source.connect(delayNode);
delayNode.connect(someMoreEffects);
someMoreEffects.connect(delayNode);
source.connect(context.destination);
delayNode.connect(context.destination);
How can I limit the amount of passes?
It's not really clear what you mean by "starts to lag", "crunch", and "amount of passes", but if you want to stop the feedback loop, disconnect the source from the delay node and/or the delay node from the destination. Or some variation of this. Or insert a gain node in the feedback loop and set the gain to 0 at some appropriate time; this will stop the feedback too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With