Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Feedback loop in Web Audio API

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?

like image 704
waterplea Avatar asked Feb 25 '26 18:02

waterplea


1 Answers

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.

like image 70
Raymond Toy Avatar answered Feb 27 '26 08:02

Raymond Toy