Пример #1
0
 private void Stop()
 {
     try
     {
         if (m_Player != null)
         {
             try
             {
                 m_Player.Dispose();
             }
             finally
             {
                 m_Player = null;
             }
         }
         if (m_Recorder != null)
         {
             try
             {
                 m_Recorder.Dispose();
             }
             finally
             {
                 m_Recorder = null;
             }
         }
         m_Fifo.Flush(); // clear all pending data
     }
     catch (Exception E)
     {
         MessageBox.Show(E.Message);
     }
 }
Пример #2
0
 private void Stop()
 {
     if (m_Player != null)
     {
         try
         {
             m_Player.Dispose();
         }
         finally
         {
             m_Player = null;
         }
     }
     if (m_Recorder != null)
     {
         try
         {
             m_Recorder.Dispose();
         }
         finally
         {
             m_Recorder = null;
         }
     }
     m_Fifo.Flush(); // clear all pending data
 }
Пример #3
0
 private void Stop()
 {
     if (_recorder != null)
     {
         try
         {
             _recorder.Dispose();
         }
         catch { }
         finally
         {
             _recorder = null;
         }
     }
     if (_isPlayer == true)
     {
         if (_player != null)
         {
             try
             {
                 _player.Dispose();
             }
             catch { }
             finally
             {
                 _player = null;
             }
         }
         _streamOut.Flush(); // clear all pending data
     }
     consoletext += DateTime.Now.ToString() + " : Audio input device polling stopped\r\n";
 }
Пример #4
0
 private void BufferClear()
 {
     if (wavePlayer != null)
     {
         try
         {
             wavePlayer.Dispose();
         }
         finally
         {
             wavePlayer = null;
         }
     }
     if (waveRecorder != null)
     {
         try
         {
             waveRecorder.Dispose();
         }
         finally
         {
             waveRecorder = null;
         }
     }
     m_Fifo.Flush();
 }
Пример #5
0
        private void GetInputDevices()
        {
            WaveInRecorder wr = new WaveInRecorder();
            int            dv = wr.GetDeviceCount();

            if (dv != 0)
            {
                string prod = "";
                for (uint x = 0; x < dv; x++)
                {
                    wr.GetInputDeviceName(x, ref prod);
                    cbInputDevices.Items.Add(prod);
                }
                cbInputDevices.SelectedIndex = 0;
                wr.GetInputDeviceName((uint)this.InputDevice, ref prod);
                cbInputDevices.Text = prod;
            }
            wr.Dispose();
        }