Hey all,
Having a problem with regards to AudioClips and Sources. Essentially, it seems like large numbers of AudioSources overwrite my looping music.
I run my level’s music from a looping AudioSource which is pretty simple (at the moment it doesn’t even have an attached script). The source has max priority (255) so shouldn’t be overwritten by any of the other AudioSources in the scene.
These sources can get numerous though. In the scene I’m testing now, I have four spaceships, each with around 6-8 AudioSources each. Generally they won’t all be playing at the same time. I’d estimate that I have a maximum of 16-20 sources playing at once, and the Listener shouldn’t be in range of most of them. These sources all have priority 128. They generally play through PlayOneShot().
When playing the level, things start off OK, but eventually the music will get cut off or silenced - the other sounds still work perfectly though. It’s getting rather vexing and I don’t quite get what could be happening. There doesn’t seem to be any real pattern to it other than it happens when a sound plays. Logging the state of the Music source indicates that it doesn’t stop or anything.
Does anyone have any ideas? I’d think I might have run into a simultaneous source playing limit, but I haven’t been able to find anything concrete (I also recall running a scene without music somewhat earlier with many more sources and no problems).