Jump to content
  • Advertisement
Sign in to follow this  
Grantyt3

MP3

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

Is it possible to use DirectSound to play an MP3 file? If not, can anyone tell me what I should use to play one?

Share this post


Link to post
Share on other sites
Advertisement
Hello, what's up!

Yes, it's possible. However, if you are making anything commercial, you shouldn't use it because of royalties. I would recommend ogg. I've heard good results using it.

Hope this helps,
exorcist_bob

Share this post


Link to post
Share on other sites
Simply put:
-DirectSound: write a decoder, play the 'raw' data.
+DirectShow: load up the mp3 and play! =)

Yes, mp3-format is licensed (ka-ching!).

Share this post


Link to post
Share on other sites
How do you write a decoder? I would think that would be a very difficult thing, but I could be wrong.

Wait, are you saying that I can either decode and play with DirectSound OR use DirectShow to play an MP3 automatically?

Share this post


Link to post
Share on other sites
An mp3 license is required for encoding, decoding, or distributing files inclusively. It does not matter if Microsoft has a decoder in Windows as part of DirectShow. Microsoft's license only covers Microsoft's use of the decoder, not yours.

Seriously, consider a patent free codec, or be prepared to pay royalties or other headaches.

Here are the current mp3 rates: http://www.mp3licensing.com/royalty/software.html

Share this post


Link to post
Share on other sites
Going with Ogg is probably a good idea, especially for commercial use. I'd also suggest Fmod. Fmod is crazy powerful and really simple to use.

Share this post


Link to post
Share on other sites
Yes, I too recommend Ogg Vorbis. Ogg compresses better than MP3 most of the time, so you get smaller file sizes as well. The only arguments Ogg are portability and quality when converting from mp3. Most mp3 player do not play ogg files, so people aren't usually willing to rip their cds to ogg. Since your music doens't have to be portable, it isn't an issue here. The other argument is probably not an issue either if you're using original music. If you still have the masters, you can encode to ogg no problem, with no loss by encoding from mp3. Of course, most people probably won't even hear the loss of quality, but you'll get lots of angry email from audiophiles.

Share this post


Link to post
Share on other sites
You can't complain about MP3 and suggest FMOD, it's contradicting the first statement. FMOD is free, but it costs a heck of a lot if you decide to sell your game at all.

Share this post


Link to post
Share on other sites
I won't be selling this game, so that won't be an issue. So, then how should I work with decoding and playing Ogg files?

Share this post


Link to post
Share on other sites
Here's an article on using OGG Vorbis with OpenAL. It's very similar to using DirectSound.

I've written code for decoding an OGG into a DirectSound buffer, but it's tied in with the rest of my sound manager code, so it's kinda hard to extract. It's really pretty straightforwards though.

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!