Playing Mp3 files without InitMovie()

Everything else that doesn't fall into one of the other PB categories.
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Playing Mp3 files without InitMovie()

Post by Fou-Lu »

Hi Everybody,

Maybe this is an off-topic issue, I am not really sure.

First of all, I really can't use InitMovie since I'm translating my application to C++. (hence the "off-topic")

I've already found a topic describing how to load and play mp3 files using the Media Control Interface (MCI). I found it really weird to send a string as a parameter even when you just want to stop the file from playing. :?
Well, it does work, but I feel there might be another better way.

As far as I know, PureBasic uses DirectShow to implement the Movie commands. I'm still reading about DirectShow, but it seems really hard to use!

Could you give me some advice on which is the better way to handle mp3 files, please?
I'm not worried specifically about code, just the most efficient techniques. :wink:

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Playing Mp3 files without InitMovie()

Post by inc. »

Do search in here for Directshow and youll find a topic where an include shows you the low level approach of direct show programming.
Check out OOP support for PB here!
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Re: Playing Mp3 files without InitMovie()

Post by Fou-Lu »

Thanks inc.! I am more familiar with PB code them C++, understanding your code will be a lot easier than the other examples I found. :)

Anyway, I am still wondering if using DirectShow is indeed the best aproach. What I am developing is a game, and DirectX Documentation makes a real confusion when it comes to DirectShow and games:
DirectShow is no longer recommended for game development. All of the DirectShow components (headers, libraries, utilities, tools, and samples) were removed from the DirectX SDK in the April 2005 release.
That makes me think DirectShow is not a good idea. But then:
DirectSound does not natively support MP3 decoding. You can decode the files in advance yourself (using an ACM codec of a DirectShow filter), or else just use DirectShow itself, which can do the decode for you; you can then copy the resulting PCM audio data into your DirectSound buffers.
Now, I don't even know for sure if I should use mp3 files in a game to begin with. :\

inc, you seem to have some experience with DirectShow, would you recommend using it in a game?

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
Post Reply