Silence Suppression Filter

[This is preliminary documentation and subject to change.]

This filter is used to detect when silence is being captured by the audio capture filter. When detected, this filter pauses a graph. This allows the SPH filter to be able to properly indicate talk spurts when packetizing audio samples.

The filter will accept PCM audio at any sampling frequency, with either 8 or 16 bits per sample. Although the filter will accept stereo data, it is implemented such that it would only consider the left channel for silence detection. The filter also needs to signal downstream filters of the beginning of a talk spurt so that they can set bits in the RTP header correctly.

The filter determines the peak and average over the sample buffers passed to it. Then, based on the EnergyFunction property, it will test one of these values against the EchoThreshold plus a "running average" to determine if it is silent. If the buffer energy is greater than this sum for RunningAverageTime then the running average is increased by AverageIncrementor. If the buffer energy falls below the running average (without adding the EchoThreshold), the running average is set to the energy of that buffer. In this way the filter will gradually adapt to background noise.

To prevent clipping, the filter will play a user-defined number of samples before and after the nonsilent data. That is, if the filter has been processing silent buffers and a nonsilent buffer is detected, the filter will deliver buffers processed prior to delivering the nonsilent buffer totaling an elapsed time of PreplayBufferTime . If the filter has been processing nonsilent buffers and it detects a silent buffer, it will deliver a silence of length PostplayBufferTime before it stops delivering silent buffers.