Microsoft DirectX 9.0

Obtaining the 3-D Buffer Object

The IDirectSound3DBuffer8 interface is obtained from a secondary DirectSound buffer that has been created with the DSBCAPS_CTRL3D flag in the dwFlags member of the DSBUFFERDESC structure.

If your application is creating and managing its own DirectSound secondary buffers without using the DirectMusic performance, you can retrieve the IDirectSound3DBuffer8 interface by calling QueryInterface method on the buffer, as in the following sample code, where lpDsbSecondary is an IDirectSoundBuffer8 interface.

HRESULT hr = lpDsbSecondary->QueryInterface(IID_IDirectSound3DBuffer8, 
                (LPVOID *)&lpDs3dBuffer); 

See Also