Exemplo n.º 1
0
 public void Initail()
 {
     Stop();
     timer1.Enabled = true;
     timer2.Enabled = true;
     //Test();
     try
     {
         _waveFormat = new WaveFormat(_audioFrameSize, _audioBitsPerSample, _audioChannels);
         // _recorder = new WaveInRecorder(0, _waveFormat, _audioFrameSize * 2, 3, new BufferDoneEventHandler(DataArrived));
         if (_isPlayer)
         {
             _player = new WaveOutPlayer(-1, _waveFormat, _audioFrameSize * 2, 3, new BufferFillEventHandler(Filler));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(DateTime.Now + " : 错误:\r\n" + ex.ToString() + "\r\n");
     }
 }