IAudio::PosnGet

HRESULT PosnGet(QWORD *pqwTimeStamp);

Retrieves the exact byte in the audio stream that is currently being played or recorded (or as exact as possible given the audio device).

· Returns NOERROR if successful, or one of these error values:

E_INVALIDARG
AUDERR_NEEDWAVEFORMAT

pqwTimeStamp

Address of the byte in the audio stream that is currently being played or recorded. The "time stamp" is actually an index into the number of bytes played/recorded by the audio stream. The time-stamp does not necessarily start at 0. Time stamps only ever increase in value over the life of the audio object, and never decrease in value. Every byte of data that passes through the audio object increases the time stamp. When the audio is UnClaimed the time stamp will not reset to 0. It might increase if the audio object is being time-shared.

The PosnGet function works only for real-time audio destinations, such as audio speakers, or real-time audio sources, such as microphones. It does not work for non-real-time destinations or sources, such as files.

An application can use PosnGet to synchronize actions with events. For example, if an action should occur at a certain interval after a particular byte is played, the application can call PosnGet to get the time that byte was played, add the interval to the time, and synchronize the action with the result.