media player programming
Hey Guys i asked this in beginners section of the forums and got no response, any way im working on a media player, but i cant get certain files to play, the thing is im using mcisendstring and im passing the filename. Anyway, i can play certain wav file(wav files that have no space in the name)But cant play mp3 files, what's up with that.
So:-
test.wav works
tes t.wav doesnt work
anything with .mp3 doesnt work here is the code, please help.
note: sFileName is the string containing the full file path.
case ID_PLAY:
{
string FileName;
//OPENING FILE
FileName="open \""+sFileName+"\" type mpegvideoaudio alias mfile";
mciSendString(FileName.c_str(),NULL, 0,0);
MessageBox(hwnd,FileName.c_str(),"Test",0);
//PLAYING FILE
FileName="play \""+sFileName+"\" from 0";
mciSendString(FileName.c_str(),NULL,0,0); MessageBox(hwnd,FileName.c_str(),"Test",0);
goto start;
}
break;
I have the Message Box after each mcisendstring to see what the FileName passed is, this i also done to see the file path to see if the spaces are ignored etc.
Turns out after both opening and playing the file path displayed in the message box is correct and includes the spaces,if i had tes t.wav in my C: the message box would first after open display
open "c:\tes t.wav" type mpegaudio alias myfile
and after play, the message box displays
play "c:\tes t.wav" from 0
This output is correct and is what is being fed to the mcisendstring function.
HOWEVER it Doesnt PLAY.Same thing with mp3's
I renamed tes t.wav to test.wav and the output was
open "c:\test.wav" type mpegaudio alias myfile
and after play, the message box displays
play "c:\test.wav" from 0
This again is correct output, and guess what, it PLAYS.
Whats up with this?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement