AudioImporter.channels seems to be a handy little addition to Unity, so that you can easily use stereo clips and get positional loudness rolloff for them. However, I just some testing, and realized that anything above -3 dB in the summed-to-mono waveform will be clipped.
In layman’s terms, loud stereo clips will get distorted when turned into mono. I logged a bug, but for now, beware.
We found and squashed a lot of these bugs during the 2.5 beta cycle. Any stragglers are probably specific to the asset. I haven’t looked at your bug report myself, but did you include the audio file or the project folder? If you reimport the file does the problem go away?
I included several files. The problem does not go away upon reimport.
As I said, the problem is definitely dependent on the asset. That is to say, any audio with loud peaks will be distorted, at least on my system. The project folder I sent includes four files:
-20 dB sine wave works perfectly
-3 dB sine wave works perfectly, but this is the very maximum of what does
0 dB and -1 dB sine waves are clipped off in each stereo channel at -3 dB
(the clip may be mono, but my playback systems have two speakers/output channels)
I really thought we nailed that one during the beta cycle… but thanks Jesse, submitting the problem files is really helpful. We’ll get this to our sound guru ASAP.
In the meantime, have you found a workaround? How about re-exporting your files with the sound levels normalized to a working level, and converting to mono with your sound editor?
Definitely, the workaround is just to use an external editor to convert to mono. In fact, that’s my only choice, in general, consider I mainly use Unity iPhone, and that version of Unity doesn’t have the mono converter yet! This is just a mild inconvenience, not a show-stopper. But, I wanted to get this post out there, in case others have the problem, and come searching the forums for what’s going on.
If anyone else does experience the distortion, however, I’d recommend just converting all files to mono externally, because it would be annoying to search all of your audio files for any samples above -3 dB.