Audio Lip Sync Filter (Windows Embedded CE 6.0)
1/6/2010
The audio sync filter is responsible for synchronizing the rate of audio playback to the rate of the incoming AV stream. This synchronization is necessary in broadcast playback where the audio playback position may drift over time compared with the rate at which broadcast material is received.
The audio sync filter provides the following functions:
- If audio data is arriving faster or slower than the audio hardware is playing, and the amount of buffered audio data rises above or falls below some threshold, the audio sync filter will slightly increase or decrease the audio playback rate to attempt to compensate. Note that this will typically affect the pitch of the audio data as well, but should not be noticeable for very small rate changes.
- If the audio sync filter determines that the amount of audio rate change required to maintain synchronization would be above some user perceptible level, the filter may decide instead to drop samples and/or temporarily mute the audio and resynchronize with the source.
- Normally, the audio renderer will attempt to act as its own clock source and will use the timestamps of the audio samples to schedule when each buffer should be played. The audio sync filter needs to disable this behavior by simply zeroing out the timestamps of each media sample before it is forwarded to the audio renderer.
Filter Property | Description |
---|---|
Filter Interfaces |
IKsPropertySet IAudioQA |
Input Pin Media Types |
MEDIATYPE_Audio, MEDIASUBTYPE_NULL, FORMAT_WaveFormatEx |
Input Pin Interfaces |
|
Output Pin Media Types |
MEDIATYPE_Audio, MEDIASUBTYPE_NULL, FORMAT_WaveFormatEx |
Output Pin Interfaces |
|
Filter CLSID |
CLSID_AudioSync |
Property Page CLSID |
No Property Page |
Executable |
AudioSync.dll |
|
|
Not used |
Remarks
The TV Audio Lip Sync filter relies on the video overlay mixer filter implementing the following interfaces:
IAlphaMixer:
This interface enables an audio lip sync filter to control both the audio and video rendering relative to the stream clock. This means that audio and video can be rendered early relative to the stream clock or late relative to the stream clock.
This preserves lip sync and will accommodate the resource needs of the MPEG decoder, which may need extra time to process complex content.
This feature is also used to smooth out the resumption of play since the DirectShow filter graph manager may not correctly estimate how much time the system needs to get all filters functioning at full capacity.
The TV Audio Lip Sync filter relies on the ability to tweak the downstream playback rate for PCM audio in order to build up buffering (by playing slowly) and in order to achieve lip sync.
IAudioRenderer:
This interface is used by the audio lip sync filter to control catch up or slow down when incoming audio is arriving too late or too early. The method SetDriftRate is used.