The IAMDirectSound interface provides access from Microsoft® DirectShow to Microsoft DirectX audio interfaces, such as IDirectSound and IDirectSoundBuffer. This enables you to play back the audio portions of DirectShow-compatible media files anywhere within the 3-D space of a DirectX application, making your applications much more absorbing and lifelike.
After 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. After 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.
Note Only the GetWindowFocus and SetWindowFocus methods are currently implemented for this interface.
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.
If you are using a WDM video capture filter, you can only query an output pin for this interface if the capture filter is connected to another filter in the graph.
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. Not currently implemented. |
| GetPrimaryBufferInterface | Retrieves a handle to the current sound device's primary sound buffer. Not currently implemented. |
| GetSecondaryBufferInterface | Retrieves a handle to the current sound device's secondary sound buffer. Not currently implemented. |
| ReleaseDirectSoundInterface | Releases the current sound device's IDirectSound interface. Not currently implemented. |
| ReleasePrimaryBufferInterface | Releases the current sound device's primary sound buffer. Not currently implemented. |
| ReleaseSecondaryBufferInterface | Releases the current sound device's secondary sound buffer. Not currently implemented. |
| 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. Not currently implemented.
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. Not currently implemented.
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. Not currently implemented.
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. Not currently implemented.
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. Not currently implemented.
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. Not currently implemented.
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.