IAudio::TotalGet

HRESULT TotalGet(PQWORD pqWord);

Retrieves the total number of bytes played or recorded by an audio device.

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

E_INVALIDARG
AUDERR_NEEDWAVEFORMAT

pqWord

Address of a QWORD value that receives the total number of bytes played or recorded by the audio device. 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.

For an audio-destination object, the value returned by TotalGet includes unplayed bytes still in the internal buffer of an audio-destination object. An application can use this value to track notifications by calling TotalGet and storing the value returned before it passes in audio data to be played. This gives the application a baseline from which to calculate when the audio will be played.

For an audio-source object, the value returned by TotalGet includes the total number of bytes recorded from the audio source, but does not include data in the internal buffer of the audio-source object. This gives the application a way of determining at what time an audio recording occurred.

An application should not assume that the value returned by TotalGet changes only with the IAudioDest::DataSet or IAudioSource::DataGet member function. If the audio device is shared, the value returned by TotalGet includes all of the audio that flows through the device, including audio played or recorded by other applications.