I want to tell XAudio 2.9 to finish up my stream with Flags = XAUDIO2_END_OF_STREAM
If AudioBytes is less than 8 bytes SubmitSourceBuffer() fails with XAUDIO2_E_INVALID_CALL.
There is no data I want to add to the buffer, I just want to flag XAUDIO2_END_OF_STREAM with AudioBytes = 0
I want to set XAUDIO2_END_OF_STREAM so that the callback for OnStreamEnd() occurs when the buffer is exhausted.
AudioBytes=0 works perfectly fine for XAudio 2.7 and below.
XAudio 2.8 is untested.
Example of attempt to set XAUDIO2_END_OF_STREAM that returns XAUDIO2_E_INVALID_CALL
XAUDIO2_BUFFER buf = {0};
buf.AudioBytes = 0; // if this is set to 8 bytes XAudio 2.9 accepts
buf.pAudioData = (BYTE*)pOffset;
buf.Flags = XAUDIO2_END_OF_STREAM;
m_pSourceVoice->SubmitSourceBuffer( &buf );