private void StopVideoCapture() { VideoSource.SignalToStop(); VideoSource.NewFrame -= NewVideoFrame; VideoSource.VideoSourceError -= VideoError; VideoSource = null; AviManager.Close(); AviManager = null; _aviStream = null; stopAll -= StopVideoCapture; }
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; }
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()); } }
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 } }