Stopping a Web Audio oscillator at cycle completion (or zero-crossing)

When calling osc.stop(), a running oscillator is stopped immediately, which can result in a nasty click. This is because the oscillator is stopped right in the middle of a cycle. Here’s a nice tutorial on how to get rid of the click, using automation curves for smooth gain fade-outs: http://alemangui.github.io/blog//2015/12/26/ramp-to-value.html But there’s another way: When stopping… Continue reading Stopping a Web Audio oscillator at cycle completion (or zero-crossing)