private static void PlayPCM(string url)
 {
     //StopPCM();
     Stop();
     byte[] buffer = File.ReadAllBytes(url);
     pcmPlayer.Load(buffer, 0);
     //pcmPlayer.Load(App.PCMBuffer, 0);
     pcmPlayer.Play();
 }
示例#2
0
文件: Main.cs 项目: radtek/WaveViewer
 private void button_play_Click(object sender, EventArgs e)
 {
     if (_wr != null && _wr.GetData() != null)
     {
         if (myChart.ChooseAreaMin < myChart.ChooseAreaMax)
         {
             _player = new PCMPlayer(_wr.GetData(),
                                     myChart.ChooseAreaMin,
                                     myChart.ChooseAreaMax,
                                     _wr.GetNum_Channels(), _wr.GetSamplesPerSec(), (short)_wr.GetBitsPerSample());
         }
         else
         {
             _player = new PCMPlayer(_wr.GetData(),
                                     0,
                                     _wr.GetData().Length,
                                     _wr.GetNum_Channels(), _wr.GetSamplesPerSec(), (short)_wr.GetBitsPerSample());
         }
         _player.Play();
     }
 }