DirectX SDK

DirectSoundBuffer.SetCurrentPosition

The DirectSoundBuffer.SetCurrentPosition method moves the current play position for secondary sound buffers.

object.SetCurrentPosition(newPosition As Long)

Parameters

object
Object expression that resolves to a DirectSoundBuffer object.
newPosition
New position, in bytes, from the beginning of the buffer that will be used when the sound buffer is played.

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 playing, it will immediately move to the new position and continue. If it is not playing, it will begin from the new position the next time the DirectSoundBuffer.Play method is called.

See Also

DirectSoundBuffer, DirectSoundBuffer.GetCurrentPosition, DirectSoundBuffer.Play