예제 #1
0
        // this is to stop the recording
        // desc:  this will first check the condition and stops the recording and then capture any left  overs recorded data which is not saved
        public void StopRecording()
        {
            events.AudioRecorderEvents.StateChanged e = new events.AudioRecorderEvents.StateChanged(mState);
            mState = AudioRecorderState.Idle;
            StateChanged(this, e);
            if (null != NotificationEvent)
            {
                Capturing = false;
                NotificationEvent.Set();
            }
            if (null != applicationBuffer)
            {
                if (applicationBuffer.Capturing)
                {
                    InitRecording(false);
                }
            }
            applicationNotify = null;
            applicationBuffer = null;
            FileInfo fi = new FileInfo(m_sFileName);

            if (fi.Length == 44)
            {
                File.Delete(m_sFileName);
            }
        }
예제 #2
0
        //it will start actual recording, append if there is data
        //in the wave file through the RecordCaptureData()
        public void StartRecording(IAudioMediaAsset asset)
        {
            events.AudioRecorderEvents.StateChanged e = new events.AudioRecorderEvents.StateChanged(mState);
            mState = AudioRecorderState.Recording;
            StateChanged(this, e);
            m_Channels   = asset.Channels;
            m_SampleRate = asset.SampleRate;
            m_bitDepth   = asset.BitDepth;
            mAsset       = new AudioMediaAsset(m_Channels, m_bitDepth, m_SampleRate);
            mAsset       = asset.Copy() as AudioMediaAsset;
            AssetManager manager = mAsset.Manager as AssetManager;

            sProjectDirectory = manager.DirPath;
            InputFormat       = GetInputFormat();
            m_sFileName       = GetFileName();
            BinaryWriter bw = new BinaryWriter(File.Create(m_sFileName));

            CreateRIFF(bw);
            CreateCaptureBuffer();
            InitRecording(true);
        }
예제 #3
0
파일: StateChanged.cs 프로젝트: daisy/obi
 public void NotifyChange(Object Sender, StateChanged state)
 {
     OnStateChangedEvent(Sender, state);
 }
예제 #4
0
파일: CatchEvents.cs 프로젝트: daisy/obi
 //Audiorecorder State
 public void CatchOnStateChangedEvent(Object sender, VirtualAudioBackend.events.AudioRecorderEvents.StateChanged state)
 {
     MessageBox.Show(state.OldState.ToString());
 }