Play more than one compressed Audio file at once,iPhone 3.0?

I know it has not been possible to play more then one compressed audio file at a time in with the iphone so far, but what about now with 3.0? Can I play several mp3’s at once now?

I don’t think 3.0 does anything to change this - still only one compressed audio file at once.

I does, actually, but the problem is that doing this requires compressed sounds to be decoded via software, which has a much higher CPU overhead. Decoding via hardware is still only one at a time and can’t be otherwise.

–Eric

Thanks for the reply’s.

Do you have any experience using software to decompress mp3’s? I am wondering how to do that (in a script in Unity…?), and also how much CPU it really takes. I have five 30 second mp3 files that I would like to play all at once for the whole level, muting and unmuting tracks depending on gameplay, but always keeping them playing.

Do you think the iPhone could handle that plus some animation going on, or is this a ridiculous idea?

Thanks!

No, the iPhone can’t handle that. Many games had performance problems with audio when OS 3.0 was released, because Apple changed the way audio session categories worked, and the usual way (using Ambient) started using software instead of hardware. This is what Unity iPhone 1.0.3 fixed: it uses a different category on OS 3.0 so it’s hardware accelerated again. You used to be able to set the audio category yourself with Objective-C code (and in fact you had to if you wanted iPod music to play), but now that Unity handles this, I don’t know how feasible it is.

–Eric

Bummer! So, if I understand that right, Unity is now back to using the hardware for decoding, so it doesnt matter that it is too much for the CPU, because it is not possible to tryt to use software decoding anyway?

I have to rethink my game then, if I am going to be able to make an iPhone version of it…

IIRC you can still switch to Ambient inside Cocoa after Unity sets the category, but keep in mind the software MP3 decompression will kill your CPU. I’m not sure how simultaneous playback of 5 MP3 files will fare.