Reputation: 43
I am using the nodeOscillator function from Web Audio API to generate a sound, however when the sound cuts it makes a pop sound (the amplitude is not zero at the cut). Does anyone know a way to check the amplitude of a nodeOscillator and wait until it is zero before I call nodeOff()?
Upvotes: 2
Views: 539
Reputation: 94
If you are using an Apple computer, take a look at this: https://vsee.zendesk.com/hc/en-us/articles/204973595-Mac-audio-pop-click-sound
Upvotes: 0
Reputation: 13928
Just fade it out on a gain node over a short time interval 1ms or so - use a setTargetAtTime - and schedule the stop for just longer than that interval.
Upvotes: 2