Attach an Audio Source component to a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary to control how and where sounds play in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary.
Audio sources are components that let you integrate sound effects, music, commentary, and other audio features into your application.
They interact with other audio components in Unity that allow you to edit, enhance, and output sound in your scene, including:
This page covers how the audio source interacts with these audio components. For more information about the Audio Source component’s properties and how to set up the component, refer to Audio Source component reference and Set up an Audio Source component.
The Audio Source component requires an Audio ClipA 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 to play sound in your scene. Audio clips are containers that hold the actual audio data, so you must assign one to the Audio Source component so it has audio data to edit and play. For instructions, refer to Assign an audio clip to your audio source.
Refer to those pages for more information about each type and for the types of audio files Unity supports.
In the Audio Source component, the Output property specifies where the audio source will send the audio signal in the audio processing pipeline.
This property accepts an Audio Mixer Group. The Audio Mixer is a tool that lets you post-process the audio with effects. You can then assign your Audio Mixer to the property to make sure your audio source applies your effects to the audio.
If you set the property to None, the sound will bypass your mixer and the audio will play without your effects. This is the default behavior.
Then, any Audio Listener components in the scene detects the audio from nearby audio sources, and outputs the audio to the user so they can hear it. Audio listeners are usually found on camerasA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary in the scene, but you can also assign them to other objects.
For more information about these components, refer to Audio ListenerA component that acts like a microphone, receiving sound from Audio Sources in the scene and outputting to the computer speakers. More info
See in Glossary and Audio Mixer.
You can configure the audio source to play the clip as 2D, 3D, or as a mixture (SpatialBlend). The audio can be spread out between speakers (stereo to 7.1) (Spread) and morphed between 3D and 2D (SpatialBlend).
If you set SpatialBlend to 0.0f
, then Unity will treat the audio clip as a 2D sound. If you set it to 1.0f
, the clip is fully 3D. Anything in between is a blend of 2D and 3D.
Use falloff curves to control the spread over distance. Also, if the listener is within one or multiple Reverb Zones, this applies reverberation to the source. You can also apply individual filters to each audio source for an even richer audio experience. For more details, refer to Audio EffectsAny effect that can modify the output of Audio Mixer components, such as filtering frequency ranges of a sound or applying reverb. More info
See in Glossary.
For a list of Audio Source settings, refer to Audio Source component reference.
The following is a list of useful API for AudioSource and its related properties.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.