Audio Clip
Audio Clips are audio data used by Audio Sources. Unity supports mono, stereo and multi (up to 8) channels audio assets. Unity supports importing the following audio file formats: .aif, .wav, .mp3, and .ogg, and the following tracker module file formats: .xm, .mod, .it, and .s3m. The tracker module assets works the same way as any other audio assets in Unity except waveform preview can be rendered to the asset import inspector.
The Audio Clip Inspector
Properties
Audio Format | The specific format that will be used for the sound at runtime. |
Native | Larger file size, higher quality. Best for very short sound effects. |
Compressed | Smaller file size, lower/variable quality. Best for medium length sound effects and music. |
3D Sound | If enabled, the sound will play back in 3D space. Both Mono and Stereo sounds can be played in 3D. |
Force to mono | If enabled, the audio clip will be down-mixed to a single channel sound. |
Load Type | The way Unity load audio assets runtime. |
Decompress on load | Decompress sounds upon load. Use this for smaller compressed sounds to avoid the performance overhead of decompressing on the fly. Beware that a compressed sound will use ~10x more memory that when decompressed, so don't use this for large files. |
Compressed in memory | Keep sounds compressed in memory and decompress while playing. This have a slight performance overhead (esp. for Ogg/Vorbis compressed files) so only use this for bigger files. |
Stream from disc | Stream audio data directly from disc. This uses a fraction of the original sounds size of memory. Use this for your music or very long tracks. Depending on the hardware, a general advice is to keep this down to 1-2 simultaneously streams. |
Compression | Amount of Compression to be applied to a Compressed clip. Statistics about file size can be seen beneath the slider. It is suggested to drag the slider to a place that leaves the playback "good enough" but still at a small enough size to meet your file size/distribution needs. |
Gapless looping | (Android/iOS ONLY) Use this when compressing a perfect looping audio source file (in a non-compressed PCM format) to preserve the loop. Standard MPEG encoders introduce silence around the loop point, which will play as little "click" or "pop". Unity handles this smoothly for you. |
Importing Audio Assets
Unity supports both Compressed and Native Audio. Any type of file (except MP3/Ogg Vorbis) will be initially imported as Native. Compressed audio files must be decompressed by the CPU while the game is running, but are smaller in file size. If Stream is checked the audio is decompressed on the fly, or else the audio is decompressed entirely upon load. Native PCM formats (WAV, AIFF) have the benefit of being higher fidelity without increasing CPU taxation, but create much larger files. Module files (.mod,.it,.s3m..xm) can deliver very high quality with an extremely low footprint.
As a general rule of thumb, Compressed audio(or modules) are best for long files like background music or dialog, and uncompressed is better for short sound effects. Tweak the amount of Compression with the compression slider to just before the difference in sound quality is noticeable.
Using 3D Audio
If an audio clip is marked as a 3D Sound then it will be played back to simulate its position in the game world's 3D space. 3D sounds emulate distance and location of sounds by attenuating volume and panning across speakers. Both mono and multiple channel sounds can be positioned in 3D. For multiple channel audio, use the spread option on the Audio Source to spread and split out the discrete channels in speaker space. Unity offers a variety of options to control and fine-tune the audio behavior in 3D space. Take a look at Audio Source.
Platform specific details
Android
On mobile platforms compressed audio is encoded as MP3 for less CPU intensive decompression.