Sign in to follow this  
caesar4

mp3 decoder

Recommended Posts

caesar4    100
i need a completely free mp3 decoder library (already looked at fmod and bass) it is preferable that it be open source, but not necessary as long as its completely free and an api documentation is provided

Share this post


Link to post
Share on other sites
Drew_Benton    1861
mpglib, part of the mpg123 project is released under the LPGL license (all you have to do is link dynamically to it).

Next is SMPEG, which is also released under the LPGL license. Don't know about the documentation, but you can look into that.

Share this post


Link to post
Share on other sites
caesar4    100
sorry, i meant to also include that it should be for Win32, and i would like to be a standalone library, like oggvorbis
and smpeg is kinda dependent on sdl

Share this post


Link to post
Share on other sites
Drew_Benton    1861
Take a look at this page. From there:
Quote:

MP3PlayLib : - Layer 1/2/3 - C - 166 k

An MPEG audio decoding library written in C. In includes Layer 1/2/3 decoders, with a good separation between them.


Doesn't look like it comes with docs, but hey, looks like it's hard to find something that has everything nowadays [wink]. It comes with sample code, but its commented in another language, I can't tell which one either, so you will have to improvise some. Anyways, best of luck! That page is the largest I've seen for Mp3 libs, so hopefully you should be able to find one there. [smile]

Share this post


Link to post
Share on other sites
Will F    1069
Quote:
Original post by caesar4
i need a completely free mp3 decoder library (already looked at fmod and bass)


To the best of my knowledge there is no such thing as a completely free mp3 decoder library because of patent issues. If you distribute a program with one you may get a letter from the lawyers representing Thomson Consumer Electronics. Then again, i'm not a lawyer, and the issue is probably more complex than how i'm describing it.

Have you considered using Ogg Vorbis? I'm not sure about all the licensing for all of the libraries, but The "Tremor" decoder library is available under a BSD-like free software license (basically you can largely do whatever you want with it).

You can download the development libraries here.

[Edited by - Will F on June 30, 2005 12:29:27 AM]

Share this post


Link to post
Share on other sites
Halsafar    205
Examine the mp3 file structure.
Stick to regular bitrate mp3's not VariableBitRate(VBR) Mp3's.

Regular mp3's usually have a header at the beginning containing the bitrate of each frame in the mp3. Then you start buffering and playing frames.

I myself have only gotten as far as parsing the header of a regular mp3. I have not gotten as far as playing the data. VBR Mp3's often have headers at the beginning of each frame which can complicate things a bit.

If anyone wish's to provide an article on how to play the sound data, I'll write a library for it.

Share this post


Link to post
Share on other sites
Will F    1069
Quote:
Original post by caesar4
im already using ogg vorbis
its just that i also want mp3 support


I could be wrong, but in order to legally provide mp3 support in your app I think you'll need to pay for a license.

Share this post


Link to post
Share on other sites
caesar4    100
mp3 support is free,
u gotta pay royalties ONLY if ure also including .mp3 files

my idea is to have an ingame mp3 player which the player can use to play HIS/HER OWN mp3s, which means that the mp3 decoder should support VBR and constant, + most common mp3 player features

Share this post


Link to post
Share on other sites
Will F    1069
Quote:
Original post by caesar4
mp3 support is free,
u gotta pay royalties ONLY if ure also including .mp3 files


I'm not a lawyer, and I might be misunderstanding the issue (it would be nice if someone who knows a definitive answer could correct me if i'm wrong). But Thomsun does own the patents for mp3.

I'd be sure to read Thomsun's Questions & Answers - Developers & Manufacturers, if you're going to distribute a mp3 encoder/decoder. I didn't spend much time reading it, there may be some exceptions.

They are asking for the following money here.

PC Software Applications - mp3
Decoder - US$ 0.75 per unit or US$ 50 000.00 - US$ 60 000.00 one-time paid-up
Encoder / Codec - US$ 2.50 - US$ 5.00 per unit

Games
mp3 US$ 2500.00 per title

Share this post


Link to post
Share on other sites
caesar4    100
Quote:

Do I need a license to use mp3/mp3PRO in games?
Yes. Games using mp3/mp3PRO encoded content are licensed on a per-title basis.

However, no license fees are due if less than 5 000 copies of a particular game title are distributed.

the game itself will be using oggs, but the player can *choose* to provide his own background music
by my understading, since the game will not be officially released using mp3 content, i think that doesnt apply to it

Share this post


Link to post
Share on other sites
WillC    548
Unfortunetly the licence fee is to cover the use of patented techniques for playing back mp3 files. This applies to the code not the actual mp3 files that you may or may not include with your game.

There's no escaping it. If you write any commercial software that contains code that could play back mp3 files (and that sells more than 5000 copies) then you must pay this license fee or risk a very expensive lawsuit.

It sucks; but it's just the way it is.

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by caesar4
Quote:

Do I need a license to use mp3/mp3PRO in games?
Yes. Games using mp3/mp3PRO encoded content are licensed on a per-title basis.

However, no license fees are due if less than 5 000 copies of a particular game title are distributed.

the game itself will be using oggs, but the player can *choose* to provide his own background music
by my understading, since the game will not be officially released using mp3 content, i think that doesnt apply to it

You don't understand. "Title" refers to the game you're making. Not to the title of a song. You're making one game? That's one title, for which you need one license (assuming you distribute more than 5,000 copies).

Share this post


Link to post
Share on other sites
Halsafar    205
WinAmp has been providing mp3 decoder support for 10+ years for free.
Only the past 5 years have they asked to pay for an upgraded version. The regular free version is just perfect and it includes decoders.

I highly doubt that the ownership of mp3 decoders in general is legal.

Its like the argument on-going with DVD's. Some guy in China I believe invented it but didn't quite patent it or something and he is constantly battling with hollywood companies to try and own it...

Personally I cannoy buy into ownership of a file format or a data storage format.
Especially since mp3's are not that hard to decode, write ur own and you'll be fine. There are thousands of free mp3 players out there which provide a codec, many of them are homebrew.

Share this post


Link to post
Share on other sites
caesar4    100
ok then, could i simply have the user get winamp and simply interface to winamp's mp3 plugin?
that way, technically i'm not providing the mp3 support, winamp is


btw sneftel, im not some fuckin idiot, i know what a game title is

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by caesar4
btw sneftel, im not some fuckin idiot, i know what a game title is

Cool it with the language very, very quickly. I was just making sure we were on the same page.

You can probably use Winamp for that sort of thing, but a better solution would be to use the DirectSound API; Microsoft's already paid Thompson for the decoder library it uses. That's what most games do.

Share this post


Link to post
Share on other sites
WillC    548
Quote:
Original post by Sneftel
a better solution would be to use the DirectSound API; Microsoft's already paid Thompson for the decoder library it uses. That's what most games do.


Are you sure about that?

I could be wrong, but I thought...

1) DirectSound doesn't support mp3 playback does it? Only PCM data?

2) You can use something like the Microsoft Window Media Format SDK (or some other decoder library) to decode the mp3 into DirectSound compatible PCM format, but you would still have to pay the license to Thomspson just the same, for any commercial application that uses that technique.

Share this post


Link to post
Share on other sites
Kurioes    250
Why don't you just write an mp3 decoder plugin for your game (i.e. a dll that is not *required* for the game to run) and make it freely downloadeble for anyone that wants it (not packaged with the game)? The plugin would not be generating revenue so you won't have to pay for a license.

Share this post


Link to post
Share on other sites
Sneftel    1788
Quote:
Original post by WillC
1) DirectSound doesn't support mp3 playback does it? Only PCM data?

2) You can use something like the Microsoft Window Media Format SDK (or some other decoder library) to decode the mp3 into DirectSound compatible PCM format, but you would still have to pay the license to Thomspson just the same, for any commercial application that uses that technique.

I misspoke somewhat. The key is to use the MP3 filter in DirectShow for the decompression; DirectSound, as you said, only handles the playback of the PCM data. The DirectShow filter is licensed by Microsoft, and is the only software component which actually uses MP3 technology.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this