iPhone - music and sound effects

Hi guys,

I'm currently trying to implement audio in my game. My framerate drops significantly when I'm trying to play even one sound effect, not to mention background music.

For example:

If I collect an item a sound should play:

function OnTriggerEnter (collision : Collider)
    if (collision.gameObject.tag == "Player")


The GameObject which has this script attached has also an audio Source with a 1-2 second audio file.

If the sound plays there is a noticable loading time the first time the sound is loaded. On top of that the framerate drops every other time. Now it sometimes happens that a player collects 2 items in arow, and 2 sounds have to be played. Now it gets really messy. The framerate drop is really big and keeps on untill one of the two sounds stops.

Is there a better way to implement audio, without sacrificing so much performance or do I have to compress the mp3 (or should I use WAV) even more

I'm working with an iPhone 4.

Really appreciate any help.

I'm not an experienced Unity/iOS developer, but I have completed and published one iPhone game using Objective C and Cocos2d. If your sound effects are mp3s, that will be a big problem. If I am remembering correctly, there is one hardware processor for decoding these (saves battery over decoding in software), but it can only handle one at a time. I'm guessing Unity is decoding the mp3s in software, which is your performance hit. Make sound effects uncompressed .wavs to avoid this.