Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Cross Platform MP3 Decoder?

Tags:

c++

gcc

mp3

decoder

I have searched high and low, and cannot find any decent MP3 decoders =/

I need one that will compile under gcc/linux.

The closest thing i could find was libmad, which has no documentation at all, and the only example I could find was the one on their home page, which is really complicated.

Does anyone know where I can find one?

like image 251
CuriousGeorge Avatar asked Jun 02 '11 03:06

CuriousGeorge


3 Answers

I have used MAD (MPEG Audio Decoder) in the past with great results, so I would not give up on it so quickly. MAD is specialy designed for good performance on CPUs without floating-point operations, which is desirable while developing applications for mobile devices for example.
I would like to recommend you to take a look on the source code of this project (GSPlayer). It is an audio player for Windows CE/Windows Mobile and it uses libmad. The code is fully functional, neat, and not too large, so it may help you to get an idea on how to use libmad on your own projects.

You may have to verify the license (GPL) for libmad though, since it may not suit your needs.

like image 199
yms Avatar answered Oct 21 '22 21:10

yms


Have you looked at Lame?

Looking at its command-line page, I can see at least a few options that look promising, such as --decode and --mp3input. That would hint that the underlying library has the ability to do what you need, I would imagine. Whether or not it has nice, well-encapsulated C++ functions for decoding mp3s is another story.

As correctly noted in the comments, you should carefully examine the licensing and patent agreements.

like image 4
Brian Kelly Avatar answered Oct 21 '22 23:10

Brian Kelly


ffmpeg should be able to handle MP3s without difficulty. How easy it is to actually access that functionality though, I cannot say.

like image 2
Billy ONeal Avatar answered Oct 21 '22 22:10

Billy ONeal