MP3s in C++ **SOLVED**

Started by
18 comments, last by zyrolasting 15 years, 5 months ago
Quote:Original post by Evil Steve
... As far as I know (Although I may be wrong), there's no open source or free MP3 decoders available, since MP3 has licensing restrictions on it...


I though of LAME right away, but it is an encoder, not sure if it does decode as well behind the scenes.

There must be something as MP3 files are playable on Linux, no money involved, either way, I'd stick with ogg, vorbis and openal just to avoid any mp3 licensing costs.

Advertisement
Quote:

I though of LAME right away, but it is an encoder, not sure if it does decode as well behind the scenes.

There must be something as MP3 files are playable on Linux, no money involved, either way, I'd stick with ogg, vorbis and openal just to avoid any mp3 licensing costs.


Links noted and bookmarked. Thanks.

However, I think I should stress again that my goal is to program all this myself.
(I know I'm still an novice, I'm just setting a long-term here)
Should I finish a project, however small it might be, I do not want licensing issues on my back, since I'm horrible at the subject and have enough to concern my projects with as is.

While I use libraries like FMOD or LAME to be able to hear BGM while under development, what should I be required to know to be able to program sound playback myself, down to encoding? Again, I know NOTHING of the subject. It's important for me to know, but I do not know a starting point. Primarily, I'm looking for a tutorial. All I found were above my league, and I don't know what topic is the base ground.
I'm also using Vorbis in my C++ projects. There's at least one audio library, Audiere, that I know is free to use (even in commercial projects), includes full source code, is portable to linux as well and does contain an MP3 decoder as well as Vorbis, Flac and Speex decoders.

Of course, I am not a lawyer and it might be that you still have to pay Fraunhofer Institute if you're actually decide to use MP3s in your game. So Vorbis ist probably a good idea. By the way, all Unreal Engine games seem to use it ;)
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Alright, Alright... Thanks, but I have all the recommendations I can handle.

Any info on actually writing some of these? I'll make my own extension if need be, I just want to one day, not have to rely on any of these libraries.
Quote:Original post by zyrolasting
After a search, came across this. Apparently MP3 could be converted to a WAV stream through some struct tweaking...
In case you were curious, Steve.
http://www.codeguru.com/forum/archive/index.php/t-370446.html


You don't need to convert MP3 on Win32.
Just play them with various MM apis.
Quote:Original post by Evil Steve
As far as I know (Although I may be wrong), there's no open source or free MP3 decoders available, since MP3 has licensing restrictions on it. Personally, I've always found DirectShow a pain in the ass to deal with, and Ogg Vorbis (And FMod) extremely simple.

You are wrong. There is an excellent free software MP3 decoder out there.
Quote:Original post by zyrolasting
Alright, Alright... Thanks, but I have all the recommendations I can handle.

Any info on actually writing some of these? I'll make my own extension if need be, I just want to one day, not have to rely on any of these libraries.


The Vorbis specification is here. Similar documentation exists for MP3, but you'll probably have to pay for it: the specification itself is ISO standard 11172-3, which is copyrighted and costs around US$200. There are also additional royalty fees for implementations of MP3, although a lot of projects (particularly open source ones) manage to slide under the legal radar.

Note that unless you are or plan to become a digital signal processing expert, trying to implement a modern audio codec yourself probably isn't a very good use of your time. Expect to spend quite a while just learning the math and terminology.
Quote:The Vorbis specification is here. Similar documentation exists for MP3, but you'll probably have to pay for it: the specification itself is ISO standard 11172-3, which is copyrighted and costs around US$200. There are also additional royalty fees for implementations of MP3, although a lot of projects (particularly open source ones) manage to slide under the legal radar.

Note that unless you are or plan to become a digital signal processing expert, trying to implement a modern audio codec yourself probably isn't a very good use of your time. Expect to spend quite a while just learning the math and terminology.


This is valuable info... So from what I'm hearing, Mp3 in itself is copyrighted, so I'd be forking money no matter the outcome, but OGG can be free for my commercial use, given I find either...

A. A freeware library,
or
B. Understand the process of streaming it myself?

Well, even so, I've been hit with extensive studies before. Are you sure that "digital signal processing expert" is appropriate to mention for my goal here? Granted, I know it will be difficult, but I just want the four basics: Play, Stop, Pause and Seek through code. I think I'll at least be able to accomplish this, even if I study for a few months. (At least, I hope) Thanks so much for the info!
Quote:Original post by zyrolasting
So from what I'm hearing, Mp3 in itself is copyrighted


It's not copyrighted, is patented.

Anyway, I totally forgot about ffmpeg, it provides you with libraries to handle both video and audio, though they are a bit complex to use, IE: if you want to get raw streams to feed to the hardware directly, ffmpeg will do just that for you.

Thanks for the additional info (and correction), I do appreciate it, but I'm trying to manage other posts now. I like the hardware streaming concept, so I'll look into it.

This topic is closed to new replies.

Advertisement