Playing certain sound during collision

I been researching how to do this and it seems that it doesn’t work in Unity 5. I have two audio attached to a gameobject. ‘swoosh’ and ‘death’. I want to play death during collision and my code seems to not working.

    AudioSource source
	void Start () {
		source = GetComponent<AudioSource> ();
	}
    void OnTriggerEnter2D(Collider2D collider){
		if (collider.tag == "Player") {
	              source.PlayOneShot(swoosh);
		}
	}

I keep getting error `swoosh’ does not exist in the current context. I’ve seen people doing this in tutorials but it seems to be not working on mine. I’m using Unity 5

In order to use PlayOneShot function you need a reference to your swoosh AudioClip;

AudioClip swoosh;//same for your second one

And then get your swoosh reference either on Awake/Start like you do with your AudioSource or make it public/[SerializeField] and set it through inspector.