Audio format choice?

I read that unfortunately, Ogg Vorbis can’t be used, because decompressing it is hard work on the iPhone. Is PCM (AIFF/WAV) our only option, then?

From what I can tell, yes. And that sucks. The wav file sizes are too big! That seriously limits the quality of music that can be used in the iPhone games.

I think it actually forces the music to sound as good as it possibly can, but yes, with the drawback of giant file sizes.

Why not just use decompress on load? That way file sizes aren’t any larger than usual. Would still have to be careful about RAM usage though.

–Eric

Is that allowed? I couldn’t tell from the manual:

“Runtime Ogg Vorbis decompression is very expensive for the iPhone’s processor and is disabled as such. When building for the iPhone, you will receive a build error if any of your project audio files are set to use Ogg Vorbis compression. You can switch these files to use uncompressed audio in the import settings.”

Can’t.

Ogg vorbis compressed audio is not supported when publishing to the iPhone. Please switch to uncompressed audio in the import settings.

TO anyone reading this post…
Unity for iPhone is very good. Amazing really. This sound thing is a small annoyance.

Says you! :stuck_out_tongue:

I have a game that comes in at 3.5 MB as a webplayer, which I was planning on remaking for the iPhone this weekend. The music files alone, uncompressed, equate to 90 MB. That’s actually a HUGE annoyance to me. :x

Can’t we compress in ogg and decompress on load ???
I can understand that realtime decompression would maybe be indeed cpu intensive, but if we want to spend some extra seconds at the beginning of our level to decompress audio and have it available decompressed at runtime, shouldn’t that be possible?

Dunno, maybe it has been overlooked?

um, sorry, but this ogg problem can’t be a problem of the iphone, i am the developer of a opensource game for the gp2x (mk100) which can play ogg in background without any hassle. the gp2x in its 1st generation is awfully slow, compared to the iphone, this can’t be a issue of the hardware. my amiga 1200 can play ogg files, ok, not in the background, but it has a 68020 with 16mhz!

Well, it’s more than a small annoyance, since it essentially means that you can’t have music. Quite disappointing really (didn’t realize about not being able to use decompress on load). What do existing iPhone games do?

–Eric

puts his name on the petition for iPhone music library support in Unity Games - even if an advanced only feature

Keep in mind that the memory on the iPhone is shared between the cpu and the gpu so putting large chunks of audio in the memory could end up limit the graphical performance of your game.

“Its a phone!” - Aras :wink:

Edit:
I wonder how fast the “disc” access is on the iPhone. Would it be possible, even when not considering engine overhead, to stream audio directly from storage?

its flash so at least 10mb/s seems to be reasonably granted.

If you have ogg / mp3 / aac, that means 10 minutes+ per second …

Yea but if you’re in wav there’d be no decompression going on. Your download size would increase considerably though.

Perhaps it would be possible to ship ogg / mp3 / aac data, permanently unpack to “disc” on the first run and then stream directly from “disc” at runtime?

Obviously you should be able to parallelise the unpacking process so that on the first load you would be able to at least get into the menu of your game without waiting for the unpacking.

You would probably then want to do some loading screen with a progress bar if the player attempts to go from the menu into the game before the unpacking process is done. Otherwise the performance of the game would suffer in the first run while the unpacking finishes.

Maybe we should wait for some unity guy to respond to this thread, because I strongly believe that this is a high priority issue for iphone development.

OK, its only a phone, but its

A) An APPLE Phone
B) A music player (especially on the Ipod Touch which is NOT a phone :slight_smile:

So maybe there is a possibility to indeed decompress sound on first run and then leave it on the iphone in the application folder. I know people don’t like to download too big apps, but hey these devices come with 8 - 16 - 32 GB space, so maybe we could use a little bit for our own sound ?

Another possibility: go back to using mod files (as in Amiga music). Someone would have to write a tracker for Unity though; actually that would be kind of cool. :wink: But really, other games seem to be able to use decent-quality music without resulting in 90MB files, so how do they do it? Like Aurora Feint…although that one does drain battery fairly quickly…

–Eric

Yeah, trackered music could also work, but please not MOD then, use .XM :slight_smile: Mod only has 4 channels

No, only the original mod used 4 channels; later versions went to 32.

–Eric

You can just use mp3s when developing natively. Apple, of course, already licenses mp3 decoding. There must be some licensing issue or compatibility issue for using Unity. Maybe Unity could support some chip tunes! :slight_smile:

p.s. woah, I stepped away before finishing my post!