To Seek By Time Using the Synchronous Reader

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

To seek for data using the synchronous reader, you specify a range for playback. A range is defined by a starting presentation time and a duration, both in 100-nanosecond units.

To seek data in an ASF file by presentation time using the synchronous reader, perform the following steps.

  1. Specify a starting time and duration for sample delivery by calling IWMSyncReader::SetRange. This method does not require you to specify a stream number because the presentation times of each stream should already be synchronized.
  2. Begin retrieving samples with calls to IWMSyncReader::GetNextSample. Proceed as you normally would with the synchronous reader.

IWMSyncReader Interface

Reading Files with the Synchronous Reader