using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioManager : MonoBehaviour
{
    private AudioSource mAudiSource;
    public static AudioManager Instance;
    private void Awake()
    {
        Instance = this;
        mAudiSource = GetComponent<AudioSource>();
    }

    public IEnumerator LoadAudio(string recordPath)
    {
        // www 加载音频
        WWW www = new WWW(recordPath);
        yield return www;
        var clipTemp = www.GetAudioClip();
        mAudiSource.clip = clipTemp;

        //播放音频
        mAudiSource.Play();
    }
    private void Update()
    {
        Debug.unityLogger.Log("是否暂停"+ mAudiSource.isPlaying);
    }
    public void StopPlay()
    {

    }
}
