Example #1
0
        private void Screen_NewFrame(object sender, Accord.Video.NewFrameEventArgs eventArgs)
        {
            if (_StartTime == DateTime.MinValue)
            {
                _StartTime = DateTime.Now;
            }
            _ScreenTotalFrames++;
            _Writer.WriteVideoFrame((Bitmap)eventArgs.Frame.Clone(), DateTime.Now - _StartTime);
            presentTime = DateTime.Now;

            if (_MicrophoneSignal != null && (presentTime - oldTime).TotalMilliseconds >= 77 * 2)
            {
                Trace.WriteLine("Time: " + _MicrophoneSignal.Duration.TotalMilliseconds);
                if (_RecordingMicrophone && _MicrophoneSignal != null)
                {
                    _Writer.WriteAudioFrame(_MicrophoneSignal);
                }

                if (_RecordingAudio && _SpeakerSignal != null)
                {
                    Trace.WriteLine("speaker");
                    _Writer.WriteAudioFrame(_SpeakerSignal);
                }
                oldTime = presentTime;
            }
        }
Example #2
0
        private void audioDevice_NewFrame(object sender, Accord.Audio.NewFrameEventArgs e)
        {
            //try
            //{

            writer.WriteAudioFrame(e.Signal);

            //}
            //catch (Exception ee)
            //{
            //}
        }