The IAMDirectSound interface provides access from Microsoft® DirectShow™ to Microsoft DirectX™ audio interfaces, such as IDirectSound and IDirectSoundBuffer. This allows you to play back the audio portions of DirectShow-compatible media files anywhere within the 3D space of a DirectX application, making your applications much more absorbing and lifelike.
Once you connect the media source file to a sound renderer on a filter graph, you can use DirectSound's functionality to position or manipulate the sound playback as needed. For more information on the relevant DirectSound interfaces and methods, see the DirectX SDK documentation. Once you finish with an interface you obtained through IAMDirectSound, be sure to release it by calling the appropriate method. If you disconnect the sound renderer from the graph before releasing the interfaces, your application might fail.
The DSound Audio Renderer filter implements this interface; for additional information on how to use this filter in your applications, see Use the DSound Audio Renderer.
When to Implement
This interface is implemented by the DSound Audio Renderer filter.
When to Use
The DSound Audio Renderer filter uses this interface; it is not intended for other uses.
Methods in Vtable Order
IUnknown Methods | Description |
QueryInterface | Returns pointers to supported interfaces. |
AddRef | Increments the reference count. |
Release | Decrements the reference count. |
IAMDirectSound Methods | Description |
GetDirectSoundInterface | Retrieves a handle to the current sound device's IDirectSound interface. |
GetPrimaryBufferInterface | Retrieves a handle to the current sound device's primary sound buffer. |
GetSecondaryBufferInterface | Retrieves a handle to the current sound device's secondary sound buffer. |
ReleaseDirectSoundInterface | Releases the current sound device's IDirectSound interface. |
ReleasePrimaryBufferInterface | Releases the current sound device's primary sound buffer. |
ReleaseSecondaryBufferInterface | Releases the current sound device's secondary sound buffer. |
SetWindowFocus | Sets the window that will handle sound playback for the current media file. |
GetWindowFocus | Retrieves the window that is handling sound playback for the current media file. |
Retrieves a handle to the current sound device's IDirectSound interface.
HRESULT IAMDirectSound::GetDirectSoundInterface(
LPDIRECTSOUND *lplpds
);
Returns one of the following values.
Value | Meaning |
E_FAIL | No sound device is available. |
E_INVALIDARG | The lplpds parameter is null. |
E_NOTIMPL | DirectSound isn't installed. |
NOERROR | The method succeeded. |
Retrieves a handle to the current sound device's primary sound buffer.
HRESULT IAMDirectSound::GetDirectSoundInterface(
LPDIRECTSOUNDBUFFER *lplpdsb
);
Returns one of the following values.
Value | Meaning |
E_FAIL | No sound device is available. |
E_INVALIDARG | The lplpdsb parameter is null. |
E_NOTIMPL | DirectSound isn't installed. |
NOERROR | The method succeeded. |
Retrieves a handle to the current sound device's secondary sound buffer.
HRESULT IAMDirectSound::GetSecondaryBufferInterface(
LPDIRECTSOUNDBUFFER *lplpdsb
);
Returns one of the following values.
Value | Meaning |
E_FAIL | No sound device is available. |
E_INVALIDARG | The lplpdsb parameter is null. |
E_NOTIMPL | DirectSound isn't installed. |
NOERROR | The method succeeded. |
Retrieves the window that is handling sound playback for the current media file.
HRESULT IAMDirectSound::GetWindowFocus(
HWND* hWnd,
BOOL bMixingOnOrOff
);
Returns one of the following values.
Value | Meaning |
E_FAIL | No sound device is available. |
E_INVALIDARG | The hWnd argument is invalid. |
E_NOTIMPL | DirectSound isn't installed. |
NOERROR | The method succeeded. |
Releases the current sound device's IDirectSound interface.
HRESULT IAMDirectSound::ReleaseDirectSoundInterface(
LPDIRECTSOUND lpds
);
Returns one of the following values.
Value | Meaning |
E_FAIL | There are no references to the specified IDirectSound interface, so it can't be released. |
E_INVALIDARG | The lpds parameter is null. |
NOERROR | The method succeeded. |
Releases the current sound device's primary sound buffer.
HRESULT IAMDirectSound::ReleasePrimaryBufferInterface(
LPDIRECTSOUNDBUFFER lpdsb
);
Returns one of the following values.
Value | Meaning |
E_FAIL | There are no references to the specified IDirectSoundBuffer interface, so it can't be released. |
E_INVALIDARG | The lpdsb parameter is null. |
NOERROR | The method succeeded. |
Releases the current sound device's secondary sound buffer.
HRESULT IAMDirectSound::ReleaseSecondaryBufferInterface(
LPDIRECTSOUNDBUFFER lpdsb
);
Returns one of the following values.
Value | Meaning |
E_FAIL | There are no references to the specified IDirectSoundBuffer interface, so it can't be released. |
E_INVALIDARG | The lpdsb parameter is null. |
NOERROR | The method succeeded. |
Sets the window that will handle sound playback for the current media file.
HRESULT IAMDirectSound::SetWindowFocus(
HWND hWnd,
BOOL bMixingOnOrOff
);
Returns one of the following values.
Value | Meaning |
E_FAIL | No sound device is available. |
E_INVALIDARG | The hWnd argument is invalid. |
E_NOTIMPL | DirectSound isn't installed. |
NOERROR | The method succeeded. |
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.