some time ago I have written a C++ class, which utilizes XAudio2 to play *.wav and *.ogg files. Recently I wanted to debug it and found out that it cannot play single channel Ogg Vorbis files, when XAUDIO_DEBUG_ENGINE was specified to create the XAudio2-Interface. This message is shown in the output window:
OAPipeline ASSERT: (UNWORD)pSRCParameters->pvSrc (null)izeof(INT16) == 0, {OAPIPELINE::ResampleLinearFromInt16MonoSse2, Line 1714}
[/quote]
When I saw this, I tried to play a stereo Ogg Vorbis and it worked. So I guess something is wrong with my WAVEFORMATEX but I still don't know why this only happens, when I use the debug runtime of XAudio2. I have got the code for loading Ogg Vorbis from this topic:
[source lang="cpp"]
vorbis_info* vi = ov_info(&m_vorbisFile, -1);
m_format.cbSize = sizeof(WAVEFORMATEX);
m_format.nChannels = vi->channels;
m_format.wBitsPerSample = 16; // Always 2 bytes
m_format.nSamplesPerSec = vi->rate;
m_format.nAvgBytesPerSec = m_format.nSamplesPerSec * m_format.nChannels * 2;
m_format.nBlockAlign = 2 * m_format.nChannels;
m_format.wFormatTag = 1;
[/source]
I would be grateful if someone could tell what I am doing wrong.
Thanks in advance.
EDIT: Solution is in my last post. Thanks SHilbert for the help.