Which sound format should I choose?

Member
Posts: 249
Joined: 2008.10
Post: #1
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.
Quote this message in a reply
Member
Posts: 440
Joined: 2002.09
Post: #2
CAF is mostly a wrapper for other formats: http://developer.apple.com/mac/library/d...intro.html

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.
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #3
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.
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #4
I thought to sell a game (if you are doing so) using the mp3 format one had to pay a license fee?

~ Bring a Pen ~
Quote this message in a reply
Member
Posts: 440
Joined: 2002.09
Post: #5
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.
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #6
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  What file sound format, sound format and library do you use? riruilo 10 7,159 Dec 27, 2008 01:32 PM
Last Post: AnotherJake