I'm trying to write a mp3 player using mci functions.(win 7 64bit,vs2010,c++)
when i try to play a mp3 file with the flag "wait" i can hear the file but everything else is stuck until the file ends playing, if i remove the flag "wait" i can continue working but can't hear a thing.
here is a sample of the code:
unsigned long __stdcall PlayThread(void *myParam)
{
char* nameOfMp3 = (char*)myParam;
char* cmd = new char[MAX_PATH];
sprintf(cmd,"open \"%s\" type MPEGvideo alias myFile",nameOfMp3);
mciSendString(cmd,NULL,0,0);
mciSendString("play myFile wait",NULL,0,0);//here is the "wait" flag
mciSendString("close myFile",NULL,0,0);
return 0;
}
i removed the checking of the return value of the mci commends but i already cheacked them and they were fine in both cases.
am i doing something wrong?