We have collected the most relevant information on Unity3d.Com Audiosource. Open the URLs, which are collected below, and you will find all the info you are interested in.
Scripting API: AudioSource - Unity
https://docs.unity3d.com/ScriptReference/AudioSource.html
An AudioSource is attached to a GameObject for playing back sounds in a 3D environment. In order to play 3D sounds you also need to have a AudioListener . The audio listener is normally attached to the camera you want to use. Whether sounds are played in 3D or 2D is determined by AudioImporter settings.
Scripting API: AudioSource.Play - Unity
https://docs.unity3d.com/ScriptReference/AudioSource.Play.html
AudioSource will assume any Play call will have a new audio clip to play. Note: The AudioSource.PlayScheduled API will give you more accurate control over when the audio clip is played. using UnityEngine; // The Audio Source component has an AudioClip option. The audio // played in this example comes from AudioClip and is called audioData.
Scripting API: AudioSource.PlayOneShot - Unity
https://docs.unity3d.com/ScriptReference/AudioSource.PlayOneShot.html
Description. Plays an AudioClip, and scales the AudioSource volume by volumeScale. AudioSource.PlayOneShot does not cancel clips that are already being played by AudioSource.PlayOneShot and AudioSource.Play. For more information on how this method differs from AudioSource.Play, see AudioSource.
Scripting API: AudioSource.spread - Unity
https://docs.unity3d.com/ScriptReference/AudioSource-spread.html
public class Example : MonoBehaviour { // when any AudioSource goes trough this transform, it will set it as 'mono' // and will restore the value to 3D effect after exiting // Make sure the audio source has a collider. void OnTriggerEnter(Collider other) { AudioSource audio = other.GetComponent<AudioSource>();
Now you know Unity3d.Com Audiosource
Now that you know Unity3d.Com Audiosource, we suggest that you familiarize yourself with information on similar questions.