I'm using mciSendString("play path repeat",0,0,0)
to play music in my project
and I'm using it specially for playing multiple sounds in the same time.
The problem is that I want to put the sounds in the executable path so I used a function to get the exe path
string ExePath() {
char buffer[MAX_PATH];
GetModuleFileName( NULL, buffer, MAX_PATH );
string::size_type pos = string( buffer ).find_last_of( "\\/" );
return string( buffer ).substr( 0, pos);
}
but mciSendString()
takes LPCSTR
so I tried the following
string music_cmd="play "+ExePath()+"\\war1.mp3 repeat";
mciSendString(music_cmd.c_str(),0,0,0);
The program runs without Errors but it doesn't play the sound. How can I fix this problem ?