I know very little about sound theory. Is this a Unity problem or a problem with audio in general? And is there anything in the new audio tools in Unity 5 I can use to remedy it?
Or is this viewed as a feature and not a problem?
Let’s say I have an enemy explosion audio clip which sounds fine on it’s own, but then I blow up 10 enemies at once and the sound is so loud it’s almost painful. I don’t really understand why this is happening unless Unity is specifically telling it to happen?
I could probably make an audio manager which divides the volume by the number of sources playing at once or something, but I’m wondering if there is (or almost expecting there to be) a builtin way of handling this. I feel like this is something you have to deal with in any game where a lot is happening at once?
This is perfectly normal. If you play sounds at the same time their amplitudes add up. Lets say you play two explosions which peak at 0dbFS that would result in a +6dbFS signal (which would clip/distort horribly because in the digital world 0db is the maxium representable value, everything above gets clipped). To circumvent this you need to employ a mix of different things.
don’t play sounds at 0db and leave headroom for the mix
use limiters on your audio busses to prevent clipping
use distance attenuation correctly
use sound prioritization
You also need to understand that dbFS has nothing to do with perceived loudness. If your sound assets don’t feel loud enough there are other ways like compression etc. to tweak that.
It’s totally normal. That particular problem (killing 30 enemies each with a death sound at once) causes performance and audio problems when it happens. It’s the very first reason we created the Master Audio plugin to tackle. Not to mention that Unity can only play 32 audio clips at the same time, so some audio may be muted when that happens.
There is no built in way to handle that, and lots of other audio problems. You’ll need to make an audio manager or buy a plugin that handles that for you.