Called when the voice finishes processing a buffer.
void OnBufferEnd( void *pBufferContext );
Context pointer assigned to the pContext member of the XAUDIO2_BUFFER structure when the buffer was submitted.
This method does not return a value.
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.