Platform SDK: DirectX |
The IDirectSoundBuffer::GetCurrentPosition method retrieves the current position of the play and write cursors in the sound buffer.
HRESULT GetCurrentPosition( LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor );
If the method succeeds, the return value is DS_OK.
If the method fails, the return value may be one of the following error values:
DSERR_INVALIDPARAM |
DSERR_PRIOLEVELNEEDED |
The write cursor 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. For more information, see Current Play and Write Positions.
It is always safe to change data that is behind the position indicated by the lpdwCurrentPlayCursor parameter.
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dsound.h.
Import Library: Use dsound.lib.