How to play several audio cllips one after another.

Hi, heres what i’m trying to do this script I have here is great, but it only plays one audio clip(Clip1) after the first one, I need it to play ten one after another, and then once it gets through them all restarts and goes again,thanks.

var Clip1: AudioClip;
var playNow = false;

yield WaitForSeconds(audio.clip.length); playNow = true;

function Update () {

if(playNow)
{
// Assign Clip1 and play it
audio.clip = Clip1;
audio.Play();
playNow = false;
}
}

Create an array of audio clips, create a for loop inside your if(playNow) statement. At the of the for loop, yield for the length of the audio clip, then increment the counter to go to the next item in the array.

Paste this into PlaySoundArray.cs, add it to a game object with an audio source. Drag the sound clips into the array once you have specified the length.

using UnityEngine; 
using System.Collections;

[RequireComponent (typeof (AudioSource))]
public class PlaySoundArray : MonoBehaviour {
	
	public float hSliderValue = 1.0f;
	public AudioClip[] clips;
	public int hideGUItime = 5;
	
	private bool GUIhidden = false;
	private float mouseMoveTime = 0f;
	private bool playNow = false;
	private int cnt = 0;
	private Vector3 tmpMousePos;

	void Update () {
		DetectMouseMov();
		
		mouseMoveTime = mouseMoveTime + Time.deltaTime;
		
		if(mouseMoveTime > hideGUItime)
			GUIhidden = true;
		else
			GUIhidden = false;
		
		if(Input.GetKeyUp(KeyCode.M)){
				playNow = !playNow;
				audio.Stop();
		}
			
		if(playNow){
	     PlaySounds();
	   	} 
	}

	void PlaySounds(){
		if(!audio.isPlaying && cnt < clips.Length){
      		audio.clip = clips[cnt];
      		audio.volume = hSliderValue;
			audio.Play();
      		cnt = cnt + 1;
     	}
    if(cnt == clips.Length)
      cnt = 0;
	}
	
    void OnGUI() {
		if(!GUIhidden){
			GUI.Label(new Rect(25, Screen.height - 50, 100, 30), "Volume");
        	hSliderValue = GUI.HorizontalSlider(new Rect(25, Screen.height - 25, 100, 30), hSliderValue, 0.0f, 1.0f);
		}
		Screen.showCursor = !GUIhidden;
	}
	
	void DetectMouseMov(){
		if (tmpMousePos != Input.mousePosition){
			mouseMoveTime = 0;
			tmpMousePos = Input.mousePosition;
		}
	}
}

Hey @Jammer3000;
Solution to your problem is;

  // declare Variable
        private bool OnPauseMenuSong = false;
void Update(){
 if (playNow)
    {
    PlaySounds();
    OnPauseMenuSong = !OnPauseMenuSong;

    if(OnPauseMenuSong == true){
    PlaySound();
    }
 }