playing a random audio clip from array in c#

Hi all, I cannot seem to get this to work.

I have create the array:

public AudioClip gravel[];

Then I have this function to randomly play a clip from the array

    void FootstepsGravel()
    {
        if (audio.isPlaying) return;
        audio.clip = gravel[Random.Range(0,gravel.length)];
        audio.Play();
    }

This however doesn’t work as it says that I cannot index from this array.

I have tried a few things to get around this, but to be honest I am stuck, please can someone point out where I have gone wrong?

Aha! its because I declared my array wrong in the first place

I should have used AudioClip gravel;

Cant see the wood for the trees sometimes!

you could also remove the part where you change the audio clip and just use

audio.PlayOneShot(gravel[Random.Range(0,gravel.length)]);

2 lines. just fyi