Hi all,
So I'm working on modding Half-life 2 to use XAudio2 instead of the built in audio engine, so I can add effects, custom rolloff curves etc. Should be pretty neat when it's done.
Anyway, I have a basic streaming thread setup. I've allocated three buffers of the same length for each voice, and use OnBufferEnd callbacks to walk through the wave file I'm streaming. So far so good, it plays the entire wav file. When I reach the last buffer, I pad the unused end of the buffer with zeros and set the XAUDIO2_END_OF_STREAM flag and submit the buffer. However, I ultimately end up hearing a click after that final buffer is submitted.
Note, I am reusing the voice and buffers, but not until another file is streamed (which in this case usually isn't for a few seconds), so I don't think this is causing the click I'm experiencing.
I'm running XAudio2 with the debug flag set, but am not seeing any debug spew indicating that a discontinuity occured.
Do any of you have any suggestions as to how I can fix this problem?