Documentation

Support

Unity Studio

Open Unity Studio

Unity Studio

Audio Source component

Use Audio Source components to play sounds in your scene.
Read time 1 minuteLast updated 2 days ago

Use the Audio Source component to attach sounds to your GameObjects, and play them when you need. This is useful for adding background music, sound effects, or any other audio elements to your scene. If you move your GameObject, the audio moves with it.

Audio Source properties

The Audio Source component has the following properties you can edit:

Property

Description

Audio ClipSelect the audio file you want to play.
MuteEnable to silence the audio. Disable to restore the audio at its set volume.
Play On AwakeEnable to have the audio play automatically when the scene starts.
VolumeAdjust the loudness of the audio. Range is from 0 (no sound) to 1 (full volume).
PitchAdjust the pitch of the audio. Higher values make the audio sound higher, lower values make it sound lower.
Min/Max DistanceAdjust how audio volume changes the further the user gets from the audio source. There are two handles that control the minimum and maximum distance values.
  • Min distance: The distance from the Audio Source at which the audio will be at full volume.
  • Max distance: The distance from the Audio Source at which the audio will stop attenuating. Beyond this distance, the audio will not be audible.

Additional resources