The IAudioMediaStream interface controls audio media streams by providing methods that set and get the stream's format. This interface inherits from the IMediaStream interface and is used to create one or more IAudioStreamSample objects. You can also use it to set and retrieve the stream data's current format.
This interface is currently defined only for PCM format audio data.
For sample code that implements the audio streaming interfaces, see Multimedia Streaming Sample Code.
When to Implement
Like video, audio is contained in a self-describing container object. Implement this interface when an object needs to control streaming audio.
When to Use
Use this interface when you want to generate audio in your application.
Methods in Vtable Order
| IUnknown methods | Description |
| QueryInterface | Retrieves pointers to supported interfaces. |
| AddRef | Increments the reference count. |
| Release | Decrements the reference count. |
| IAudioMediaStream methods | Description |
| GetFormat | Retrieves the stream data's current format. |
| SetFormat | Sets the format for the stream. |
| CreateSample | Creates an audio stream sample for use with this stream. |
Creates an audio stream sample for use with the specified stream.
HRESULT CreateSample(
IAudioData *pAudioData,
DWORD dwFlags,
IAudioStreamSample **ppSample
);
Returns S_OK if successful or E_POINTER if one or more of the required parameters are NULL.
The pAudioData object defines the data's format.
Retrieves the stream data's current format.
HRESULT GetFormat(
WAVEFORMATEX *pWaveFormatCurrent );
Returns S_OK if successful or E_POINTER if the required parameter is NULL.
Currently, DirectShow only supports PCM wave data.
Sets the format for the stream.
HRESULT SetFormat(
const WAVEFORMATEX *lpWaveFormat
);
Returns an HRESULT value, which can include the following values or others not listed.
| Value | Meaning |
| MS_E_INCOMPATIBLE | Format of the IAudioData object is not compatible with stream. |
| E_POINTER | Null pointer argument. |
| E_INVALIDARG | Invalid argument. |
| S_OK | Success. |
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.