I know there are already some questions about this points in this forum, but I can’t find a good complete response. Basically, I have several sounds for my games, and I have the sound in any format (wav, mp3…), so which one should I use?
Typically WAVs are used for small sounds files (sound effects) and MP3s are used for longer, streamed files (background music).
Reasoning is that the WAVs will be stored in memory and there’s little runtime overhead to decode them when you want play them (bullet sfx that 100s of times throughout the game). MP3s for a a background song on the other hand could be 3 MB, and the uncompressed wav file of that same file could be >10 MB. Not something you want sitting around in memory, so it’s better to leave them compressed, and use stream from disc. Little overhead when you’re just doing this for one music track.
1 - Any Audio File imported into Unity is available from scripts as an Audio Clip instance, which is effectively just a container for the audio data. The clips must be used in conjunction with Audio Sources and an Audio Listener in order to actually generate sound. When you attach your clip to an object in the game, it adds an Audio Source component to the object, which has Volume, Pitch and a numerous other properties. While a Source is playing, an Audio Listener can “hear” all sources within range, and the combination of those sources gives the sound that will actually be heard through the speakers. There can be only one Audio Listener in your scene, and this is usually attached to the Main Camera.
Supported Formats

Font: Unity - Manual: Audio files
2 - Create one Sound Controller:
using UnityEngine;
using System.Collections;
public enum soundsGame{
die,
toque,
menu,
point,
wing
}
public class SoundController : MonoBehaviour {
public AudioClip soundDie;
public AudioClip soundToque;
public AudioClip soundMenu;
public AudioClip soundPoint;
public AudioClip soundWing;
public static SoundController instance;
// Use this for initialization
void Start () {
instance = this;
}
public static void PlaySound(soundsGame currentSound){
switch(currentSound){
case soundsGame.die:{
instance.audio.PlayOneShot(instance.soundDie);
}
break;
case soundsGame.toque:{
instance.audio.PlayOneShot(instance.soundToque);}
break;
case soundsGame.menu:{
instance.audio.PlayOneShot(instance.soundMenu);
}
break;
case soundsGame.point:{
instance.audio.PlayOneShot(instance.soundPoint);
}
break;
case soundsGame.wing:{
instance.audio.PlayOneShot(instance.soundWing);
}
break;
}
}
}
3 - Create one GameObject(example: cube).
4 - Insert component audio source.
5 - Drag class SoundController to GameObject.
6 - Drag audio(.mp3 or .wav) to Script GameObject(Example: Sound toque).