Platform SDK: DirectX

DirectSoundBuffer.SetCurrentPosition

The DirectSoundBuffer.SetCurrentPosition method moves the current play position in the buffer.

object.SetCurrentPosition(newPosition As Long)

Parameters

object
Object expression that resolves to a DirectSoundBuffer object.
newPosition
Offset in bytes from the beginning of the buffer for the play position.

Error Codes

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

DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

This method cannot be called on primary sound buffers.

If the buffer is already playing, it immediately moves to the new position and continues. If it is not playing, it begins from the new position the next time the DirectSoundBuffer.Play method is called.

See Also

DirectSoundBuffer.GetCurrentPosition