DirectX SDK

DirectSoundBuffer.GetCurrentPosition

The DirectSoundBuffer.GetCurrentPosition method retrieves the current position of the play and write cursors in the sound buffer.

object.GetCurrentPosition(cursors As DSCURSORS)

Parameters

object
Object expression that resolves to a DirectSoundBuffer object.
cursors
A DSCURSORS type that contains the current play position and the current write position in the DirectSoundBuffer object. This position is an offset within the sound buffer and is specified in bytes.

Error Codes

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

DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED

Remarks

The lWrite member indicates the position at which it is safe to write new data to the buffer. The write cursor always leads the play cursor, typically by about 15 milliseconds' worth of audio data.

It is always safe to change data that is behind the position indicated by the lPlay member.

See Also

DirectSoundBuffer, DirectSoundBuffer.SetCurrentPosition