using UnityEngine;
using System.Collections;

public class VoiceManager : MonoBehaviour
{

    public AudioSource m_audioSource;
    public AudioClip[] m_clips;

    public static VoiceManager ms_instance;
    public static VoiceManager Instance
    {
        get { return ms_instance; }
    }
    
    // Use this for initialization
    void Start()
    {
         if (ms_instance != null)
        {
            Debug.LogError("Only one musicman allowed");
        }
        ms_instance = this;
        m_audioSource.loop = false;
        m_audioSource.volume = m_audioSource.volume * 1.0f;

    }

    public void Play( int i )
    {
        if ( i < m_clips.Length )
        {
            m_audioSource.clip = m_clips[i];
            m_audioSource.Play();
        }
    }

    public bool IsPlaying
    {
        get { return m_audioSource.isPlaying; }
    }

    // Update is called once per frame
    void Update()
    {
    }
}
