Play sound on button press?

I have wrote this script which I think is supposed to play a sound when the LMB is pressed,
but I have lots of errors which I’m guessing means this script isn’t possible. Can any take a look and help me out?

function Update () {

if(Input.GetButtonDown(“Fire1”)){

  audio.Play("sniper rifle gunshot");

}

}

audio.Play() only plays the sound assigned to audio.clip - you can’t pass the file name. The object to which this script is attached must have an AudioSource, and the sound must be imported with menu option Assets/Import New Asset… and assigned to the AudioSource clip property (Audio Clip, in the Inspector).

If you have different sounds to play in the same object, you can change the clip property and use Play, or use PlayOneShot(sound), where sound is an AudioClip variable.

Use audio.Play without any arguments:

audio.Play(); // play the current audio.clip AudioClip

Or define the AudioClip variables and play one of them with audio.PlayOneShot:

var sound1: AudioClip; // drag the sound 1 here
var sound2: AudioClip; // drag the sound 2 here
...
audio.PlayOneShot(sound1);