I played with XAudio2 but ran into some weird issues with the mmioOpen function
For some reason, it seems to fail with MMIOERR_FILENOTFOUND , although there is a file, in fact the file is in the same directory as the other files that I load, which work fine ...
The wav files they use for testing are the only ones that were in the SDK samples in August, which work fine if I copy the names to the XAudio2BasicSound sample ... In some cases I needed to rename the sounds, for example, 1.wav, to make them open ...
//"Counting.wav" does not work Sounds.append(Audio.Sound(L"c:/test/xaudio2/Counting.wav")) Sounds.append(Audio.Sound(L"Electro_1.wav")) //"heli.wav" does not work Sounds.append(Audio.Sound(L"c:/test/xaudio2/heli.wav")) //"HipHoppy_1.wav" does not work //"c:/test/xaudio2/HipHoppy_1.wav" does not work Sounds.append(Audio.Sound(L"1.wav")) Sounds.append(Audio.Sound(L"MusicMono.wav")) Sounds.append(Audio.Sound(L"MusicSurround.wav")) //"Techno_1.wav" does not work //"c:/test/xaudio2/Techno_1.wav" does not work Sounds.append(Audio.Sound(L"2.wav"))
I just use the wav class from SDKwavefile.h. I added the mmioinfo structure to get the error number and at the ticket offices that do not work, he gave me MMIOERR_FILENOTFOUND , although the files are there, everything is in the same directory ... I just changed line 63 so that I can get the error code from mmioOpen . Audio.Sound does nothing with the string, except to pass it to the wav.Open method.
MMIOINFO info; ZeroMemory(&info, sizeof(MMIOINFO)); m_hmmio = mmioOpen( strFileName, &info, MMIO_ALLOCBUF | MMIO_READ ); if(!h_hmmio) std::wcout << L"Error Code: " << info.wErrorRet << L"\n";
I really see no reason why he cannot open some of these waves ...
source share