How i can have Randomize Audio Clip in unity

my script have not error but i do not know do not work:

using UnityEngine;
using System.Collections;

public class random: MonoBehaviour {
	public AudioClip[] gravel; 

	void Update()
	{
		if (!GetComponent<AudioSource>().isPlaying){
		GetComponent<AudioSource>().PlayOneShot(gravel[Random.Range(0,gravel.Length-1)]);
		}
	}
}

More of a description of what does not work would be helpful for solving your problem. But when I tested it with 2 sounds I found that it only plays the first, the reason for that is Random.Range has an exclusive max. So instead just use Random.Range(0,gravel.Length) to access all of the elements in your array.

Bonus note: you can make your script more efficient by only doing GetComponent once in the Awake method.

     public AudioClip[] gravel; 
     private AudioSource source;

     void Awake()
     {
          source = GetComponent<AudioSource>();
     }

     void Update()
     {
         if (!source.isPlaying)
         {
         source.PlayOneShot(gravel[Random.Range(0,gravel.Length)]);
         }
     }