Version: Unity 6.1 (6000.1)
Language : English
Audio files
Audio file format compatibility

Introduction to audio files

As with Meshes or Textures, the workflow for Audio File assets is designed to be smooth and simple. Unity can import almost every common file format, but there are a few details that are useful to be aware of when you work with audio files.

For an extensive description of the compressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary
formats and other options available for encoding audio data, refer to Audio Clip Import Settings reference.

Audio data and Audio Clips

Unity audio data is separate from the actual Audio ClipsA container for audio data in Unity. Unity supports mono, stereo and multichannel audio assets (up to eight channels). Unity can import .aif, .wav, .mp3, and .ogg audio file format, and .xm, .mod, .it, and .s3m tracker module formats. More info
See in Glossary
. Audio data is the raw information about an audio file. It contains information such as length, channel count, sample rate, and compression format.

Audio Clips are assets that contain the audio data and processes the audio data for use with Unity Engine. Audio Clips contain the audio data used by Audio SourcesA component which plays back an Audio Clip in the scene to an audio listener or through an audio mixer. More info
See in Glossary
.

Alter the settings of your audio file

Use the settings in the Audio Clip Import Settings to determine how the clips will load at runtime. These settings let you decide which audio assets will stay in memory. This is ideal for frequent or unpredictable sounds like footsteps, weapons, or impacts.

For other assets, such as speech, background music, or ambient loops, you can set them to load on-demand or as the player progresses. This approach optimizes memory usage and improves performance.

Use audio files in your scripts

Any audio file imported into Unity is available from scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
as an AudioClip instance. This provides a way for the game runtime of the audio system to access the encoded audio data. The game might access meta-information about the audio data via the AudioClip even before the actual audio data loads.

The import process extracts information such as length, channel count and sample rate from the encoded audio data and stores these details in the AudioClip. This information can be useful for automatic dialog or music sequencing systems, because the music engine can use the length to schedule music playback before the data loads. It also helps to reduce memory usage because it only keeps the audio clips in memory the application needs at a certain time.

For more information and code examples, refer to the API documentation for AudioClip.

Additional resources

Audio files
Audio file format compatibility