Jump to content
  • Advertisement
Sign in to follow this  
bikola_p

media player programming

This topic is 4826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!