Introduction to the Audio Source component
Set up an Audio Source component
Audio Source component referenceView and edit the properties and settings of the audio source to change how it plays audio.
To open the audio sourceâs settings, select 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 that contains an Audio SourceA component which plays back an Audio Clip in the scene to an audio listener or through an audio mixer. More info
See in Glossary component. To learn how to create an audio source, refer to Set up an Audio Source component.
Use the following settings to change how an audio source plays an audio clip.
Property Description Audio Resource Reference to the audio resource the audio source will play. You can assign a Audio Clip or an Audio Random Container to this property. Output Determines how the audio source will route and process the audio before it reaches the userâs speakers. By default, the clip is output directly to the Audio Listener in the 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 infoPlay()
command in your 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 infoThe following settings are applied proportionally to the Spatial Blend parameter.
Property Description Doppler Level Determines how much Doppler effect you want to apply to this audio source. For no effect, set this to 0. Spread Sets the spread angle to 3D stereo or multichannel sound in speaker space. Min Distance Within the MinDistance, the sound will stay at the maximum volume. Outside MinDistance, attenuation begins. Increase the MinDistance of a sound to make it âlouderâ in a 3D world, and decrease it to make it âquieterâ in a 3D world. Max Distance In linear mode, this is the point where the volume reaches zero and the sound becomes inaudible. For custom curves, this is the distance where the sound stops attenuation and stays constant. If you use Logarithmic Rolloff, Unity ignores this setting. Volume Rolloff How fast the sound fades. The higher the value, the closer the listener has to be before they can hear the sound. - Logarithmic Rolloff The sound is loud when youâre close to the audio source and quickly disappears as you initially move away, but then slowly tapers off progressively and never quite disappears. This is more physically accurate and good for more localized sources of sounds. - Linear Rolloff The further away from the audio source you go, the less you can hear it. But, due to how hearing perception is logarithmic, this makes sounds appear more present at further distances and less localized. - Custom Rolloff The sound from the audio source behaves according to how you set the Volume distance curve. Rolloff Modes that an audio source can have. Distance functions Curve EditorThe Audio Source component contains a group of curves you can use to modify several properties of the audio. These curves represent each property as a function of the distance between the audio source and the audio listener.
The following are audio properties you can use the curves to configure:
Property Description Volume Defines how loud the audio is (0.0 to 1.0) as its distance from the audio listener changes. If you edit this curve, Unity automatically changes the Volume Rolloff to Custom Rolloff. Spatial Blend 2D (original channel mapping) to 3D (all channels down-mixed to mono and attenuated according to distance and direction). Spread Angle (degrees 0.0 to 360.0) over distance. Low-Pass Cutoff frequency (22000.0 to 10.0) over distance. This property only appears if you attach a LowPassFilter component to the same GameObject as the audio source. Reverb Zone Amount of signal routed to the reverb zones. Note that the volume property and distance and directional attenuation are applied to the signal first and therefore affect both the direct and reverberated signals. Distance functions for Volume, Spatial Blend, Spread, Low-Pass audio filter, and Reverb Zone Mix. The current distance to the Audio Listener is marked in the graph by the red vertical line.To modify the distance functions, you can edit the curves directly. For more information, refer to the guide to Editing Curves.
Additional resourcesIntroduction to the Audio Source component
Set up an Audio Source component
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4