Closed samreid closed 5 years ago
I added 10
then 100
ms delay to the stop
call and still heard the clicking when the tone ends. The problem seems to be happening on this.oscillator.disconnect( this.masterGainNode );
. I wonder if we need to schedule that for after the stop delay has occurred? @jbphet can you please advise?
@jbphet and I looked into it. SoundGenerator is already doing the fade out, we just need to wait until the fade out is complete before stopping the oscillator. Committed, tested and closing.
@jbphet says there can be some clicking when an audio clip ends. You can use delay parameter on stop, like 10ms. And also set the volume to 0, something like stop(10ms). Probably can use the default time constant for setOutputLevel(0). If you still hear the clicks, adjust the time constant.