The IAudioMediaStream interface controls audio media streams. This interface inherits from the IMediaStream interface and is used to create one or more IAudioStreamSample objects. It is also used to set and retrieve the current format of the stream data.
Note, this interface is currently only defined for PCM format audio data.
For sample code which implements the audio streaming interfaces see Multimedia Streaming Sample Code.
When to Implement
Like video, audio is considered to be contained in a self-describing container object. Implement this interface on objects that control streaming audio.
When to Use
Use this interface when you want to output audio.
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 current format of the stream data in a WAVEFORMATEX structure. |
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 this 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 format of the data is defined by the pAudioData object.
Retrieves the current format of the stream data in a WAVEFORMATEX structure.
HRESULT GetFormat(
WAVEFORMATEX *pWaveFormatCurrent );
Returns S_OK if successful or E_POINTER if required parameter is null.
Currently only PCM wave data is supported.
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 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.