Ejemplo n.º 1
0
 private void StopVideoCapture()
 {
     VideoSource.SignalToStop();
     VideoSource.NewFrame         -= NewVideoFrame;
     VideoSource.VideoSourceError -= VideoError;
     VideoSource = null;
     AviManager.Close();
     AviManager = null;
     _aviStream = null;
     stopAll   -= StopVideoCapture;
 }
Ejemplo n.º 2
0
        private void StopVoiceCapture()
        {
            AudioCapture.SignalToStop();

            FrameRate    = (double)BitmapsCount / _waveEncoder.Duration * 1000;
            BitmapsCount = 0;

            AudioCapture.NewFrame         -= NewAudioFrame;
            AudioCapture.AudioSourceError -= AudioError;
            AudioCapture = null;
            _waveEncoder = null;
            _audioStream.Close();
            _audioStream = null;
            stopAll     -= StopVoiceCapture;
        }
Ejemplo n.º 3
0
 public void Play()
 {
     if (PlayerState == PlayerState.uninitialised)
     {
         LoadFile();
     }
     if (PlayerState == PlayerState.loaded)
     {
         PlayFromStart();
         ReportStatus?.Invoke(this, new StatusEventArgs("Playing " + SFX.ShortFileNameOnly));
     }
     if (bnStopAll.Checked)
     {
         StopAll?.Invoke(this, new EventArgs());
     }
 }
Ejemplo n.º 4
0
        public void StartCapture(string fileName, CaptureTypeEnum captureType = CaptureTypeEnum.VoiceCapture)
        {
            TempFileName = fileName;
            CaptureType  = captureType;

            if (captureType.Equals(CaptureTypeEnum.VoiceCapture) || captureType.Equals(CaptureTypeEnum.VideoCaptureWithVoice))
            {
                StartVoiceCapture(captureType.Equals(CaptureTypeEnum.VideoCaptureWithVoice) ? TempVoice : fileName);
                stopAll += StopVoiceCapture;
            }

            if (captureType.Equals(CaptureTypeEnum.VideoCapture) || captureType.Equals(CaptureTypeEnum.VideoCaptureWithVoice))
            {
                StartVideoCapture(captureType.Equals(CaptureTypeEnum.VideoCaptureWithVoice) ? TempVideo : fileName);
                stopAll += StopVideoCapture;
            }

            if (!String.IsNullOrEmpty(TempFileName))
            {
                var tm = new TimerCallback(TimeOut);                  // set callback
                _stopTimer = new Timer(tm, 0, 1000 * 600, 1000 * 60); // 1 min
            }
        }