iOS Compressed Audio - max number of streams

I’ve got multiple compressed, streamed audio tracks in my Unity 4 iOS game and as I switch from one to another I’d like it to crossfade. I recall reading somewhere that you can only have one compressed audio stream playing at once - is that still true ?

Why is that the case - is it a hardware limit? If it is does it only apply if I use hardware decoding?

As far as i remember it’s a hardware limit. Unity uses the natively available decoder that is provided by the OS.

As you might know MP3 always was a big problem when it comes to patents. That’s most likely why Unity did not include an MP3 decoder into the engine and only supports formats where the decoders are free from patents. However on mobile the hardware can handle the decoding so you as Unity app developer don’t have to worry about patents.

I’m not sure if there are still patents on the base mp3 format (according to WP there isn’t) but if you use / implement a third party decoder be careful about patents which might still be valid up to date.

I once implemented a third party, 100% managed code mp3 decoder in Unity which even worked in the webplayer. However it converted the whole mp3 into an audioclip, so streaming wasn’t supported. Of course the decoding took some time and will eat a lot of memory since the output is uncompressed PCM. I never published that decoder as i’m not sure about the legal situation myself ^^.