mp3 support for iOS / mobile

So what are my options for including / reintroducing mp3 support for non flash platforms - particularly iOS / Android / HTML5.

I understand the licensing implications.

I should note that this is just for music, not sound, so no mixing etc is necessary, (although access to id3 tag is).



MP3 is supported in some browsers already, ATM you sort of have to have MP3, OGG and WAV formats for all audio files for it to work on all major browsers.

As for native, I assume we would need to decode ourselves. This is technically feasible, but I have not known one person to raise their hand and say “I’ll pay $2500 to play MP3 instead of OGG”

For this reason, I’m inclined to block support, so people don’t violate licenses unwittingly.

However, another option would be compile-time conversion of MP3 to OGG. I think that would cost $1.50 in licensing costs, so that could be wrapped in some cheap plugin.

(unless there is some system library on iOS/Android I’m not thinking of that would do the decoding for us and possibly save us the licensing issue)

What do you think?

I understand your reluctance to support a patent encumbered tech. Unfortunately, my (non-game) app has a lot of dynamically created Text to Speech audio that is created in mp3 on a server.

I’m thinking that calling the system libraries on mobile would be the way to do this. I don’t require any fancy mixing or effects, just straightforward play, pause, and a way to query the current position of the play head. And ID3 support.

Where would be a good place for me to insert this in the codebase? Would it best go in an extension or wrapped in #if invokeMP3Licence / #end in the main native audio code?


Perhaps a native extension would be the ideal path for this. It seems overly complex when we know we could plug in a C++ decoder at a native level, but I don’t think anyone wants to pay those licensing fees.

On Android, it would be the MusicPlayer class in Java (perhaps?) that would do it. There’s a JNI class in OpenFL that can make it possible to hit JNI APIs without getting weird into C++, I think we could make a @:jni macro in Lime to make even this easier :smile:

For iOS, perhaps it would be some AudioPlayer API to do a simple play/pause/stop of a track?