|This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.|
The IDsCaptureDriverBuffer::GetPositionmethod is called when DirectSound is querying the current position of the specified sound capture buffer.
HRESULT GetCurrentPosition( LPDWORD lpdwCurrentCaptureCursor , LPDWORD lpdwCurrentWriteCursor );
Returns DS_OK if successful, or one of the following error values otherwise:
The driver returns two values: the current capture cursor, and the current write cursor. The capture cursor is the position which is currently being captured. The write cursor is the next position at which it is acceptable to write new data into the buffer. The write cursor should be as close as possible to the capture cursor — preferably within one or two samples. Note that DirectSound does not return these exact values to applications; instead it adds a buffer zone of about 10 milliseconds to the write cursor to cover multi-tasking delays, and so on.
Some hardware may not be able to notify DirectSound when a one-shot buffer has finished capturing. Therefore, if the driver returns a position that is equal to the length of the buffer, DirectSound assumes that the buffer has finished capturing and should stop. DirectSound then calls IDsCaptureDriverBuffer::Stopon that buffer. This should only happen for one-shot secondary buffers.
Last updated on Tuesday, July 13, 2004