Platform SDK: DirectX

DirectSoundBuffer.Play

The DirectSoundBuffer.Play method causes the sound buffer to play from the current play position.

object.Play(flags As CONST_DSBPLAYFLAGS)

Parameters

object
Object expression that resolves to a DirectSoundBuffer object.
flags
Flags that specify how to play the buffer. This is one of the constants of the CONST_DSBPLAYFLAGS enumeration.

Error Codes

If the method fails, an error is raised and Err.Number may be set to one of the following error codes.

DSERR_BUFFERLOST
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

This method causes a secondary sound buffer to be mixed into the primary sound buffer and sent to the sound device.

If the buffer specified in the method is already playing, the call to the method succeeds and the buffer continues to play. However, the flags defined in the most recent call supersede flags defined in previous calls.

Before this method can be called on a sound buffer, the application must call the DirectSound.SetCooperativeLevel method.