IXAudio2VoiceCallback::OnVoiceProcessingPassStart Method

Called during each processing pass for each voice, just before XAudio2 reads data from the voice’s buffer queue.

Syntax

public:
void OnVoiceProcessingPassStart(
         UINT32 BytesRequired
)  

Parameters

BytesRequired
Type: UINT32 

The number of bytes that must be submitted immediately to avoid starvation. This allows the implementation of just-in-time streaming scenarios; the client can keep the absolute minimum data queued on the voice at all times, and pass it fresh data just before the data is required. This model provides the lowest possible latency attainable with XAudio2. For xWMA and XMA data BytesRequired will always be zero, since the concept of a frame of xWMA or XMA data is meaningless.

Note

  In a situation where there is always plenty of data available on the source voice, BytesRequired should always report zero, because it doesn’t need any samples immediately to avoid glitching.

Return value

None.

Remarks

For information about IXAudio2VoiceCallback interface methods, see the XAudio2 Callbacks topic.

Requirements

Header: Declared in xaudio2.h.

Library: Use xaudio2.lib.

See also

IXAudio2VoiceCallback

IXAudio2VoiceCallback Members