I am trying to write some code that can play an .mp3 file. I thought I could use the mciSendString call, but I am getting a strange error.
So, when I have this code:
int rc=mciSendString(L"open songname.mp3 alias song1", NULL, 0, 0);
rc
returns with the number 266, and the error string returned with GetErrorString
was:
"Unknown problem while loading the specified device driver."
Error 266 is MCIERR_CANNOT_LOAD_DRIVER
I have also tried:
int rc=mciSendString(L"open songname.mp3 type mpegvideo alias song1", NULL, 0, 0);
and received the same error.
I thought it may be the mp3 file, but I tried a few different ones and kept getting the same error.
My code is in C++ and is running on Windows 7. Is my code missing something?
Try surrounding
songname.mp3
with an extra pair of quotes (be sure to escape them with backslashes).