Jump to content
  • Advertisement
Sign in to follow this  
Varchild

Stopping an MP3 file in midstream

This topic is 4881 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

I have an MP3 file that is running but how do I stop the MP3 file in midstream so that I can play a different MP3 file? I am using this code to run the MP3 "IMediaControl *pMediaControl; IMediaEvent *pEvent; pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl); pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent); pGraph->RenderFile(L"C:\\Song1.mp3", NULL); pMediaControl->Run();" Now I would like the gamer to press a button on the keyboard and stop the MP3 from playing without ending my application. If I type in this code: "pMediaControl->Stop();" My entire application closes:-( If I type in this code: "pMediaCotnrol->StopWhenReady();" My application will stop the song but the application freezes and quits.:-( I am unable to run my next song file because the application is quitting all of the time.:-( Thanks for any help you can provide.

Share this post


Link to post
Share on other sites
Advertisement
Well, Stop() is the correct function to call. I use it now in my DS wrapper without a problem. The only thing I can think of is you're doing something incorrect that we cant see. Which would mean your program isn't just closing, its crashing. Run it in debug a few times and see whats going on there. If you need to drop some code and let us take a looksee.

regards,
Tang

Share this post


Link to post
Share on other sites
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!