Пример #1
0
 public void startRecording()
 {
     if (!_isRecording)
     {
         aRecorder = getRecorder();
         if (aRecorder.getState() == AudioState.STATE_INITIALIZED)
         {
             _isRecording = true;
             aRecorder.startRecording();
             SamplesReaderThread s = new SamplesReaderThread(this, _outStream, getMinBufferSize());
             s.start();
         }
         else
         {
             Console.WriteLine("***AudioRecord not initialized, calling stop for cleaning!");
             stopRecording();
         }
     }
 }
Пример #2
0
        public override bool startCapturer()
        {
            // start recording
            try
            {
                m_audioRecord.startRecording();
            }
            catch (System.InvalidOperationException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
                return(false);
            }

            m_captureLock.@lock();
            m_isCapturing = true;
            m_captureEvent.signal();
            m_captureLock.unlock();

            return(true);
        }