Overloading with Audiosources, making a music game

Hi. I’m making a music sequencer in Unity. Right now I’m using scripts to instantiate prefabs which play audio on awake and destruct when they’re done. It’s working fine, until I get over 40 or so AudioSources in the scene, then Unity nearly stops playing sounds. Is there a maximum amount of AudioSources or memory allocated to Audio? Is there some way around it?
I’m looking to play over 30 or more sound clips at once. the sound file is a 100kb .mp3 .

I don’t have an answer, but since you haven’t gotten any responses yet I’ll go ahead and reply.

I think I’ve observed the behavior you’re describing as well. Obviously having that many audio sources playing at once is an unusual case, but I sort of ran across it incidentally at one point, and I remember the audio system seeming to essentially ‘shut down’, as you describe.

There’s some information in the docs under AudioSource.priority about how audio channels are handled in Unity, but I’m not sure if it sheds any light on this particular situation. If a significant number of audio channels are being virtualized (assuming that means what I think it means), it may just be that the system is getting overloaded. Maybe it should be ‘failing more gracefully’ in that case, or maybe what you’re seeing is the expected behavior (I don’t know for sure either way).

You could always create a test case and file a bug report, of course. It may or may not be a bug, but at least that would give the Unity team a chance to take a look at it.

Thank you. I noticed that bumping up the priority helps, but it still hits a limit. I’ll file the bug report to see if I can get an explanation, but its reasonable to accept that there are limits.

posted to Unity Answers and bumped
http://answers.unity3d.com/questions/27997/too-many-audiosources

Having major problems. I’m only playing 60 channels on my ios music app (obviously they are virtualized) but sound breaks up. Any fix or advice?

its fairly essential I play that many simultaneous sounds, yes.