IXAudio2VoiceCallback::OnBufferEnd method

Called when the voice finishes processing a buffer.

Syntax


virtual void OnBufferEnd(
   void *pBufferContext
) = 0;

Parameters

pBufferContext

Context pointer assigned to the pContext member of the XAUDIO2_BUFFER structure when the buffer was submitted.

Return value

This method does not return a value.

Remarks

After an OnBufferEnd callback the audio memory for the buffer associated with pBufferContext can safely be released.

pBufferContext is the context pointer originally provided by the pContext member of the XAUDIO2_BUFFER structure, which may be NULL.

OnBufferEnd is guaranteed to be called just after the last byte of the current buffer has been consumed and before the first byte of the next buffer is consumed. This callback can be used to overwrite or release the audio data referenced by the completed buffer, and to update other state associated with the voice as appropriate.

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

Platform Requirements

Windows 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

Requirements

Header

Xaudio2.h

See also

IXAudio2VoiceCallback
How to: Use Source Voice Callbacks
How to: Stream a Sound from Disk

 

 

Show: