unity play sound code example
Example 1: stop sound in unity
audioSource.Play();//Start playing
audioSource.Stop();//Stop playing
Example 2: play sound unity
AudioSource audioData;
void Start()
{
audioData = GetComponent<AudioSource>();
audioData.Play(0);
Debug.Log("started");
}
Example 3: how to play sound in unity
public AudioSource Jump;
Jump.Play();