Thinking about adding mp3 support to irrKlang

I am currently thinking about adding mp3 support to irrKlang, the free sound library I wrote. After all, it is the most frequently user requested feature and of course it would be very useful - OGG which is already supported by irrKlang isn't that popular yet. I'm not only thinking about if I am adding mp3 support, but also how. The if-problem is that since mp3 is now quite popular, Thomson is demanding royality payments if you create software or hardware working with this compression format, they've patented it. I've heard they usually don't ask people providing free software to pay, but nobody would be able to stop them once they start doing it.
The how-problem also has something to do with the patent and license fees and looks like this:
  • First option: I could write my own mp3 decoder. This one has the most disadvantages: Takes the most time and has the highest risk of getting a Thomson cash target. So I won't do this.
  • Second: Use the operating system built-in decoder. Since modern operation systems like WinXP provide APIs to decode mp3s I could use this. Advantages: Quickly implemented, low risk of license payment requests because there is actually no code in my software dealing with mp3 decoding. Disadvantage: Probably not that high performance, risk of not working on crippled PCs.
  • Third and last option: Write an irrKlang plugin using one of the many open source decoders, and probably also release its code as example. Would work with GPL and LGPL open source decoders, could be removed from the lib by simply deleting the plugin .dll and has the same risk of being cash milked as all the other open source libs.
So I'm not sure if I should choose option two or three. Any ideas or suggestions?

31 comments, already:

I think third option is better
Aranoth (link) - 05 12 06 - 21:00

Why are you bothering with mp3 ?
Alexander - 05 12 06 - 22:22

Actually I don’t understand the necessity of adding MP3 to the library. irrKlang is a sound library – not a media player that needs to serve non-developers. The Vorbis encoder can be used freely so why do people still want to use the patent troubled MP3 codec? Anyway if it needs to be done, the third option seems to be the preferred one.
oli - 05 12 06 - 22:31

I would have to agree with oli… MP3 support isn’t that big of a deal for this kind of lib. It would be nice, but it isn’t a killer when ogg is just as good and totally free… The people who will be using irrklang will have enough knowledge to be able to convert audio files. Even if you do nothing… If someone really wants MP3 they can make a plugin instead of telling you to.

This is just my two cents tho… It is totally up to you niko.
SkaCahToa - 05 12 06 - 22:55

given the choices, if it were me i’d do option 2 if anything at all. most likely the OS vendor has already paid license to thomson. even if not, it’s their decoder, not yours so you avoid liability. all the same tho, i agree with oli too, irrKlang doesn’t really need mp3 support. ogg works great, and its honestly no harder to use. If I were to suggest adding any new formats I’d suggest a lossless format, like FLAC. then irrklang would be ready-to-use for serious audio applications too, like multi-track editors or something. the other useful thing would be a .NET binding…
buhatkj - 05 12 06 - 23:35

Are 2 and 3 really that different from the programming point of view? From the legal point of view you should be also fine with both solutions, because accessing an API without actually providing the patented decoder parts is definitely safe. So simply choose the alternative you can finish faster. But keep in mind that 2 is not as portable as 3 :-)
hybrid - 06 12 06 - 01:07

Honestly save your time for irrlicht or other improvements, devs use OGG because of no license fees/issues so it’s just making a rod for your own back (and prob won’t be used for much).
no mp3 - 06 12 06 - 01:22

After seeing some more info about Microsoft’s game dev studio / XNA stuff, what theyre doing makes sense. they compile all media into formats that are faster and all the same to increase speed… so having support for 3 million formats isnt always neccesary… especially for something that’s free.
RabidLockerGnome () (link) - 06 12 06 - 02:34

What about .OGG?
WhiteNoise () (link) - 06 12 06 - 02:51

As said earlier, don’t waste your time on mp3. Ogg is becoming quite popular on games, even the mainstream ones.
IMHO, I think you should save your time for more interesting features.
deadmilkman () - 06 12 06 - 03:16

option 2
cmoibenlepro - 06 12 06 - 04:53

I say option 3 or ogg.
TSM - 06 12 06 - 07:48

It is quite easy to convert mp3 to ogg, so I don’t see a reason for adding mp3 support…
Didl - 06 12 06 - 07:50

Today more and more ppl have hi-fi speakers, and so prefer listening to lossless audio formats. Who cares about the size today, when you can have TBs of storage at home. I think that .ogg and .flac must be supported from such library.
qbk () (link) - 06 12 06 - 09:12

Yea I wouldnt bother with MP3 format at all, I haven’t used it in years in favor of OGG.
StuC_OVINE - 06 12 06 - 09:23

I aggre with most. People should be able to convert an audiofile. I don’t have used IrrKlang, so I don’t know the API, but why not implement a PluginAPI so users need to implement the mp3 plugin for themself and you don’t have the licence problems on your site.
sober - 06 12 06 - 10:53

3, and then, if you want, one of the plugins uses the operating system built-in decoder as implementation. Is it possible?
stef_ - 06 12 06 - 11:20

1) Don’t waste your time with mp3: lower quality and patent cannot be classified as features. 2) There is no way that a computer user, especially a developer, can convert to mp3 and can’t convert the vorbis. 3) If you really, really want to waste your time (and why should you? We are waiting for IrrEdit on Linux and Mac OS X :-p) option 3 appears to be the only possible one: option 2 doesn’t look a good crossplatform way to me…
flowolf () - 06 12 06 - 11:38

I’ll go for OGG, you could help spread the love for that format.

In case you still want to add support for MP3, I say the option 3 is the way to go. ;)
bicunisa (link) - 06 12 06 - 14:02

Don’t add MP3 support. Just look for a free mp3 to ogg converter and include the URL in the readme.txt. ;)
MarcoTMP () (link) - 06 12 06 - 14:30

I agree with MarcoTMP. Why use mp3? Ogg is just perfect to get the job done (i.e. to get the music/sound played).
But if you think that it’s necessary to add mp3 support, I’d prefer the third option.
KIENI () - 06 12 06 - 15:08

If you’re aiming for simplicity I can see why you’d add mp3 support. I’d go for option 3.

In 1998/9 I used FreeAmp to add mp3 playing to Quake2 as part of a deathmatch / LAN party mod I wrote. Playing deathmatch to Queen’s “Don’t stop me now” was classic ;)
Steve () (link) - 06 12 06 - 15:32

I think that I need not support MP3 to irrKlang.
If it is necessary, I direct three.
I want you to open the source code to the public from it.
MadHyde - 06 12 06 - 20:01

thanks for all the suggestions, lets see. BTW: irrKlang already supports .OGG files.
niko - 06 12 06 - 20:51

Add support for MOD,XM,S3M,IT, etc instead!!
Mr D - 06 12 06 - 22:04

Ok niko since this is about. IrrKlang. I think adding mp3 support would not be such a bad idea. but i would prefer you used a plugin or the OS decoder.. Please dont bother with making your own decoder.. It will just be issues and issues with Thomson and a waste of time since ogg sounds ok. Plus Thomson is just nailing the coffin to MP3 people my just entirely shift to OGG or something like that. MP3 was made because there was a time when space was an issue but nower days.. i think the the price for space is 1GB = 1$. Anyways its a good thing people have being hanging on MP3 for soo long. I mean other media stuff have move soo forward.. movies are now in h264/dvix/xvid and images are in HDI/dds/jpeg2.. its about time audio moved on.

One more thing can you please add Midi support I know Midi is not important in games as it isnt used as much but i think it would be a great addition to irrKlang. Useless but helpfull for just play testing esp since i have like 10000+ midi in my comp :). Anyways i can convert them to .OGG easy but still…

leo () - 07 12 06 - 12:13

I’d sooner see support for MOD and other related formats. MIDI is a worthless format and can be easily translated to MOD using a tracker like the Modplug Tracker. Not to mention the size increase is generally small. :P
Frobozz - 08 12 06 - 09:40

Go on wid mp3! I think it cud come in handy for bg muzic in games! The 3rd option wud be the betta one in my opinion as u r decreasing portability by option 2! Neways’s u r the boss, do whatever u feel best!
Rapchik Programmer () - 11 12 06 - 18:16

That was me
BlindSide - 13 12 06 - 14:00

I say no mp3, MOD support wud be nice thru the use of a third party lib I think audiere uses DMOD? to play mods
BlindSide - 13 12 06 - 14:01

I think that adding mp3 support is a good idea, its an easy format to come across, lots of stuff is in it.

You should do like the audacity guys do, and say “if you want to add mp3 support, you must download lame (or whatever decoder/encoder) yourself. That would free you from any copyright infringement thingy’s.
Kaeles - 20 12 06 - 11:46

Remember personal info?
Email (optional):
URL (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

  ( Register your username / Log in )

Notify: Yes, send me email when someone replies.  

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.