using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Audio;

namespace xna_finall
{
    class MyAudio
    {
        //參照
        //http://blog.sina.com.cn/s/blog_8fae19f801016nqo.html
        AudioEngine ae; // 音效引擎
        WaveBank wb; // Wave 檔案倉庫 (Wave Bank) 
        SoundBank sb; // 聲音倉庫 (Sound Bank)

        public MyAudio()
        {
            //讀入Content中的檔案
            ae = new AudioEngine("Content\\newProject.xgs");
            wb = new WaveBank(ae, "Content\\Wave Bank.xwb");
            sb = new SoundBank(ae, "Content\\Sound Bank.xsb");
        }

        //播放音效
        public void PlaySound(string name)
        {
            sb.PlayCue(name);
        }
    }
}
