• Advertisement
Sign in to follow this  

MP3

This topic is 4333 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
If you need an example of ogg file loading download
Lyradis ( http://www.pumpkinpieman.net/files.php?focusid=1#1 )

and take a look at the files.

cSound.h
cSound.cpp
cSoundLoader.h
cSoundLoader.cpp
cSoundLoaderOGG.h
cSoundLoaderOGG.cpp

They're relativly small files, but it will show you how to read ogg files from a file stream, as well as reading them from memory. (I don't think GD has an article on that) So you can cache those small files in to memory without doing any unneccessary hd seeks.

Share this post


Link to post
Share on other sites
Thanks, but I found a C# Ogg player that I implemented and it's working great!

Share this post


Link to post
Share on other sites
So, if I have an ogg file of an song that I got off iTunes and I don't sell my game, is that legal?

Share this post


Link to post
Share on other sites
Quote:
Original post by Grantyt3
So, if I have an ogg file of an song that I got off iTunes and I don't sell my game, is that legal?


NO

Using Ogg - ok
Using a song off iTunes - not ok

Whenever you use someone else's work you need permission from whoever owns the copyright for that work. Depending on the song you'll need to license it from either the original author or from the music company that owns the rights. It will cost you a pretty penny. It doesn't matter if you sell the game or not. You cannot use someone else's work without their permission.

It's far easier to use original music made specifically for your game.

-me

Share this post


Link to post
Share on other sites
I can't beleive it, but this is the first I've heard of MP3s requiring a license. I feel as if I must have been living under a rock! :P

Anyway, I just read this up on Thomson's mp3licensing.com site:

Quote:
5) Do I need a license to distribute mp3, mp3PRO or mp3surround encoded content?

Yes. A license is needed for commercial (i.e., revenue-generating) use of mp3/mp3PRO in broadcast systems (terrestrial, satellite, cable and/or other distribution channels), streaming applications (via Internet, intranets and/or other networks), other content distribution systems (pay-audio or audio-on-demand applications and the like) or for use of mp3/mp3PRO on physical media (compact discs, digital versatile discs, semiconductor chips, hard drives, memory cards and the like).

However, no license is needed for private, non-commercial activities (e.g., home-entertainment, receiving broadcasts and creating a personal music library), not generating revenue or other consideration of any kind or for entities with associated annual gross revenue less than US$100,000.00.


That last sentence baffled me a bit, since I'd probably never make $1,000 off one of my projects, let alone $100k.

But just to be on the safe side, is anyone here using FLAC? or just OGG?

It looked to me like FMOD supports both (FLAC and OGG), so I may give that a try -- Their licensing is not that bad for their shareware license (and it's free for freeware projects - also a plus).

Sorry to ramble a bit. Interesting topic though. Sure glad I found out about it before getting into a real project, however. Thanks for the heads up! :D

Share this post


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

  • Advertisement