AudioSource + AudioClip + iOS = bad performance?

Hey guys

I’m trying to play some sound effects in my game (iOS) unfortunately the performance are really really bad…
I have the impression that the sound is loaded in memory before each play…
I’m not sure how to manually manage the memory for audio clip in unity (actually does it even make sense ?)
I was actually expecting this to be managed directly by unity so I believe I must be missing something…

I’ve tried heaps of different solutions…
using playOneShot on an AudioSource component
using the static PlayClipAtPoint function (on AudioSource)
using Play directly on a AudioClip (member of my gameobject)

so far I always have the same performance issue (even in the editor actually, when I display the graphics stats, sometimes a frame would go up to 20ms instead of just 3ms…)
my sounds are in wav format so they should not require any decompression (the sound I use for testing is also pretty small : less than a second long)
from the unity documentation, it seems to be the fastest way to play a sound…
I’ve forced them to mono in order to save a bit of memory and the load type is “decompress on load”

anyway I’m pretty confused and would be happy with any help you could provide

cheers
oX

use decompress on load.

yes I do that already

also I use the WAV format so I don’t think the compression settings really matter

I’m using aiff on my iOS title, and i have more than: 92 sound clips!

And all this play at last 10 at same time, beside the music background!

But I make one sound manager, to create and destroy this AudioClips when i don’t need anymore.

One thing i experienced this bad performance is when i Instantiate my AudioClip, you can’t do something like that:

AudioClip instance = Instantiate(Resources.Load(acPath,typeof(AudioClip))) as AudioClip;

and must do like that:

AudioClip instance = Resources.Load(acPath,typeof(AudioClip)) as AudioClip;

You may want to check out our Audio Toolkit on the Asset Store which is performance optimized for mobile devices (e.g. creating audio sources only when needed by using object pools)

Find more info on our website: http://unity.clockstone.com