My code
char MusicLoc [50][200];
char Music [50][50];
int MusicBox(int IndexMusic)
{
std::string rawloc = ((std::string)"open \""+MusicLoc[IndexMusic]+Music[IndexMusic]+"\"type mpegvideo alias "+Music[IndexMusic]);`
mciSendString(rawloc.c_str(), NULL, 0, 0);
mciSendString(((std::string)"play "+Music[IndexMusic]).c_str(), NULL, 0, 0);
return 0;
}
MusicLoc contains the path and Music contains the filename, so MusicLoc[1]+Music[1] would be C:\etc\etc\etc\audio.mp3 , it worked fine at first but then it randomly stopped working , I have tried everything and it doesn't work so I am gonna guess using mciSendString isn't recomended, so does anyone knows about a good and lightweight audio library?
Edit: The first mciSendString returns 266, and the second one return 275, if its of any use, but I really haven't found good documentation about them.
Also GetLastError says there is no error...
If there is no error, the return from mciSendString should be zero. Your question suggests that you are getting errors!
To decode the errors nicely, use mciGetErrorString
Something like this ( ripped from my code, so you will have to adjust variable names, etc )