Fade audio after a given time under a dB threshold

The example demonstrates two methods. This first one uses smoothing to create a ramp on and off instead of an instantaneous switch on and off. This second one waits a certain amount of time before it begins the release ramp, and if the input signal goes back above the threshold during that time it cancels the release (the default amplitude threshold being -40 dB).

Chapter: