Beispiel #1
0
        // TODO: Handle the case where recorderSubscription ends early
        private void StopRecording()
        {
            /* Start recognizing frames again */
            var frameObserver = new FrameObserver(brain);

            recognizeAvailableFrameSubscription = videoProvider.FrameAvailable.Subscribe(frameObserver);
        }
Beispiel #2
0
        public void Init(
            IBrain brain,
            IVideoProvider videoProvider,
            IVideoRecorder videoRecorder,
            IAudioRecorder audioRecorder,
            IAudioPlayer audioPlayer,
            IAudioRepository audioRepository)
        {
            this.brain         = brain;
            this.videoProvider = videoProvider;
            this.videoRecorder = videoRecorder;
            this.audioRecorder = audioRecorder;

            var frameObserver           = new FrameObserver(brain);
            var frameRecognizedObserver = new FrameRecognizedObserver(audioPlayer, audioRepository);

            recognizeAvailableFrameSubscription = videoProvider.FrameAvailable.Subscribe(frameObserver);

            this.lifetimeStreams = new CompositeDisposable
            {
                brain.FrameRecognized.Subscribe(frameRecognizedObserver),
                videoRecorder.RecordingAvailable.Subscribe(new VideoPublisher(brain)),
                audioRecorder.RecordingAvailable.Subscribe(new AudioPublisher(audioRepository))
            };
        }