using UnityEngine;
using System.Collections;

public class AudioManager : MonoBehaviour {
    public AudioClip[] background;
    public AudioSource bgSource;
	// Use this for initialization
	void Start () {
	    
	}
	
	// Update is called once per frame
	void Update () {
        if (!bgSource.isPlaying)
        {

            bgSource.clip = background[(int)Random.Range(0, background.Length - 1)];
            bgSource.pitch = Random.Range(0.95f, 1.05f);
            bgSource.Play();
        }
    }
}
