iDevGames Forums
Which sound format should I choose? - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Which sound format should I choose? (/thread-55.html)

Which sound format should I choose? - riruilo - May 20, 2010 01:25 PM

Hi mates!

What is the optimun sound format for the iPhone? I mean, frecuency, stereo/mono, bit rate...

And I see many games use CAF instead of MP3 or WAV, Is CAF a special format for the iPhone?

By the way, I'm using FMOD for the iPhone.

Thanks for reply.

Which sound format should I choose? - Frank C. - May 20, 2010 02:31 PM

CAF is mostly a wrapper for other formats:

If you're using FMOD then there's not much to gain by packing sounds into CAF files since FMOD has its own loaders. In fact, I'm pretty sure FMOD won't know what to do with a CAF file.

In general, mono 16bit 22KHz little-endian wav is the most reasonable format for FX (where you're mixing a bunch of sounds at once, perhaps in 3D). Whether you're using FMOD or OpenAL or whatever.

For music, you'll want to use compressed m4a (AAC) files with the hardware decoder (16bit 22KHz or 44.1KHz is fine, even mp3 will work). I'm not sure if FMOD actually lets you use the hardware or not - it didn't last time I checked, but that was a long time ago. I'm pretty sure FMOD still doesn't support m4a though.

Which sound format should I choose? - AnotherJake - May 20, 2010 04:32 PM

In addition to what Frank said (I noticed he mentioned mp3 too), I'd say mp3 is also pretty good to use for music, since the hardware decoder works fine with it too -- we haven't had any problems with mp3 at all.

Which sound format should I choose? - mikey - May 21, 2010 11:44 AM

I thought to sell a game (if you are doing so) using the mp3 format one had to pay a license fee?

Which sound format should I choose? - Frank C. - May 21, 2010 12:52 PM

As far as MP3 goes, if you're using Apple supplied decoders (in hardware or otherwise) then you should be free of any licensing issues - AFAIK, IANAL.

For FMOD, they specifically tell you an MP3 license is NOT included, so you're on your own. However, I do see that the development branch of FMOD now supports hardware decoding on iPhone OS, and (I think) even Apple's software decoders in OS 3.0 and up. So in those cases you'd also be covered by Apple's license (again IANAL). On a side note, this also means FMOD will finally support AAC on iPhone.

Still, there's not much point using mp3 unless you're playing music from an unknown source. For your own music, m4a/AAC will give you better quality at a similar or smaller size than mp3, and I wouldn't hesitate to suggest that Apple probably puts more effort into optimizing AAC playback over mp3.

Which sound format should I choose? - AnotherJake - May 21, 2010 01:24 PM

I was making the assumption that we were talking about hardware decoding. If you're doing that then the only way is through Apple's decoders, as far as I know. So even if FMOD is doing it, they'd have to go through Apple's decoder anyway. So, yeah, as far as I've ever understood it, since Apple has the license for the mp3 decoder it shouldn't be a problem.

In terms of actual quality between aac and mp3, that's subjective as far as I'm concerned. You wanna use aac? Go for it. I'm just saying mp3 works fine. In terms of performance, I've never really seen any major difference, although I'm not claiming there isn't any. I think the debate between aac or mp3 is pretty much just splitting hairs. I personally can't recommend one over the other.

On the opposite end of the spectrum, if you're not doing hardware decoding, then I'd prefer to use Ogg/Vorbis for compressed audio over anything else.