DirectShow MP3

Started by
3 comments, last by snowball123 21 years, 10 months ago
Hi, I''m using DirectShow for an MP3 player. I want to play a MP3 file, once its done, the player will be play another MP3 file. My problem is that it plays both files. It runs through the first MP3 file. It stops the first MP3 file, then it loads the second MP3 file and plays it. But both are MP3 files are played at the same time (really kindy funny). Do I need to release all objects related to DirectShow? Or is there a way to get around this without releasing everything? Thanks
Advertisement
You need to remove the first set of filters from the graph prior to inserting the filters for the second file.
Or destroy the graph object and recreate it.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Thanks for the earlier reply.

I''ve been destroying the graph and recreating it. That works well. But how do I remove the filter and add a new one for the next MP3?


I saw within the graph object there is this method called removeFilter or something. And I also saw addSourceFilter or do I load the next MP3 file like the previous one and it does all the work? I was wondering if you could help me out with this part, I would appreciate.


Again Thanks
It''s fast enough to call the release method on the interfaces your''re using, and then recreate the graph.
I got a nice skinned DirectShow MP3 Player up on my site. Full Source, check it out. It was hacked out pretty quick and is very sloppy but it got the job done. Unfortunetly it only play''s one MP3 but I used it in a game of mine and it played as many as you wanted (at the same time even). Check it out: www.CodeFortress.com in the Projects section way don in the bottom.
"Artificial Intelligence: the art of making computers that behave like the ones in movies."www.CodeFortress.com

This topic is closed to new replies.

Advertisement