To Retrieve Stream Samples with 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.]

Like the asynchronous reader, the synchronous reader can retrieve samples by stream number. Unlike the asynchronous reader, the synchronous reader can deliver stream samples either compressed or uncompressed.

To receive stream samples, perform the following steps.

  1. Any time before or during playback, call IWMSyncReader::SetReadStreamSamples passing the desired stream number.
  2. Retrieve samples with continued calls to IWMSyncReader::GetNextSample.

You can check whether a stream is selected for sample delivery by calling IWMSyncReader::GetReadStreamSamples.

IWMSyncReader Interface

Reading Files with the Synchronous Reader