mp3 support suggestions


I need to be able to import mp3 files (for a commercial product) and was wandering if anyone has any suggestions or information as to the best way to do this? FFmpeg looks OK however I am concerned regarding the licensing issues. Is there any other solutions, payed licensing is fine as long as it’s reasonable. We can use quicktime on the Mac however we need a unified solution for PC and Mac, Thanks in advance for any help!


you can use quicktime on windows, too


Yes that is true but we like a more transparent method if possible, thanks for your suggestion, appreciate it.


I have an open-source, liberally-licensed source code project that uses the cross-platform LGPL mpg123 library to read mp3s - you can find it at This gives you a Juce-style PositionableAudioSource of the uncompressed audio which you can use cross-platform for your playback or transfer needs (or if you just want to write it to a file it’s two or three lines of C++ from there…)

I’m very interested in having other people use this, and revealing bugs for me to fix, because it’s going into a commercial product of mine that’s going out quite soon! It isn’t packaged as a library, though, you’d have to put it in your own code area and compile it as part of your build.



Thanks for the information, what licensing considerations are there for your implementation, do we have to include anything in the Euler… Thanks again!


I think it is generally safer to dynamically link with a LGPL library in a commercial product.
Now, what exactly is the license of your adapter code Tom? If it is a free software license you should say it in the comments of each file to be clearer.

Regarding MP3, I think the patent business is a bigger problem than the code license. You can find open source encoders/decoders easily, but the format itself is patented and if you use it in your commercial product, it is risky…
If you ask a lawyer about it, please tell us what he said, I’d be interested :slight_smile:


There is no evidence for this, as far as I know! And dynamic linking IMHO results in a more fragile product. I am aware that there is some minor controversy over this, but I rely on the fact that I am very contributory to the community and follow the spirit of the rules closely - if someone later wants to give us grief and make me dynamically link, so be it, but I believe that will never happen.

It’s all licensed under the very permissive “IDC” license, at the top of the tree - basically, I Don’t Care what you do with it (as long as you don’t get in my way). :smiley:

These are snapshots from my working directory and so have no copyright information on them - were I to spend the time my first priority would be properly packaging them. Thinking of them more as “examples of best practice” might be accurate. However, the code is quite solid.

Regarding licensing issues with respect to mp3, legal matters are best not discussed on public forums! but the summary is that we already pay licensing fees for other parts of our technology and are quite prepared to pay licensing for the mp3 format if it becomes a part of our product. Our current release version does not in fact use (or need) mp3 at all…

I’d also note that there’s no open source software to write mp3s so you’re pretty well required to license someone else’s package unless you want to do the work yourself, which is foolish.

Another thought might be to use either QuickTime or LAME or libmpg123 if it existed on the target system and give people advice as to how to download them - but that’s a sort of patchwork solution - and frankly, since this is a patent and not a copyright, it’s absolutely not clear that this does actually get around the licensing fees anyway (though people have successfully done this in the past).

Summary is that we intend to be good citizens and comply with laws and ethics - and also rely on the fact that we’re a tiny company with small revenues and if we are accidentally infringing on something we’d expect to get a request and simply pay it.


I don’t remember how it used to work with the LGPL v2, but the v3 is pretty clear about that (source:

[quote]d) Do one of the following:

   0) Convey the Minimal Corresponding Source under the terms of this
   License, and the Corresponding Application Code in a form
   suitable for, and under terms that permit, the user to
   recombine or relink the Application with a modified version of
   the Linked Version to produce a modified Combined Work, in the
   manner specified by section 6 of the GNU GPL for conveying
   Corresponding Source.

   1) Use a suitable shared library mechanism for linking with the
   Library.  A suitable mechanism is one that (a) uses at run time
   a copy of the Library already present on the user's computer
   system, and (b) will operate properly with a modified version
   of the Library that is interface-compatible with the Linked

The user is supposed to be able to interchange the LGPL part with its own interface-compatible custom version. But I’m not a lawyer so that’s just my understanding.
But you’re not concerned because you give away your code, I was more talking about the person who said he wanted to bundle it in a commercial application. Of course nobody will come give you grief. It is usually just when you make a lot of money that people tend to wake up and say “hey that’s my code!”… :slight_smile:
So no pb for 99% of us.

That’s a strategy. I prefer not to give big fishes a good reason to take us down in an endless lawsuit and settle this in advance.

Thanks for your code anyways. It seems to be quite robust indeed.


There are two separate questions here - one is whether we’re complying with the LGPL and the other is royalties for other people’s commercial IP.

One of the products I’m working on is, in fact, a commercial application that uses LGPL libraries, and I do intend to statically link them. I don’t really understand dynamic libraries properly on either of our two target platforms, and so far I’ve been able to put everything in the binary so right now there’s only one file to give to people.

My theory is that if someone really perceives that I’m not complying with the LGPL, then they just aren’t going to lawyer up - if for no other reason than there really isn’t any money it for them - they’re going to send me a polite email and then I can work with them to make them happy.

In the case of free software, I really do believe that people are in it because they love the idea of free software. I’m very conscientious about contributing to the community, a little here, somewhat more in the Max/Max4Live/Mac Javascript community. In a very real sense, every minute I spend futzing around with dynamic vs. static linking is a minute I’m not spending on open source development. My theory is that people will say, “OK, he statically links, but he open-sourced a Juce interface for our library, so he’s a good guy, and we won’t bother him.”