Microsoft DirectX 8.0 (C++) |
Overrides the default DirectSound object or buffer, or both, to which a port's wave data is streamed. This method is also used to disconnect the port from DirectSound.
HRESULT SetDirectSound( LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer );
If the method succeeds, the return value is S_OK or DMUS_S_NOBUFFERCONTROL. See Remarks.
If it fails, the method can return one of the following error values:
DMUS_E_ALREADY_ACTIVATED |
E_INVALIDARG |
If a valid pointer is passed in pDirectSoundBuffer, the method returns DMUS_S_NOBUFFERCONTROL if control changes in the buffer such as pan and volume do not affect DirectMusic playback. This affects only Windows Driver Model (WDM) ports.
When the port is activated, the primary DirectSound buffer is upgraded, if necessary, to support the sample rate and channel information for this port (specified in the DMUS_PORTPARAMS8 structure passed to IDirectMusic8::CreatePort).
The buffer pointed to by pDirectSoundBuffer must be a secondary streaming buffer with a format that matches the sample rate and channel information for this port. If this parameter is NULL, an appropriate IDirectSoundBuffer instance is created internally.
Neither the IDirectSound nor the IDirectSoundBuffer can be changed after the port has been activated.
Header: Declared in dmusicc.h.