Beispiel #1
0
        public TextToSpeech(SpeechRecognition sr)
        {
            this.sr          = sr;
            this.synthesizer = new SpeechSynthesizer();
            this.responder   = new NetworkResponder(false);
            this.responder.Bind("33407");
            // Configure the audio output to default settings
            this.synthesizer.SetOutputToDefaultAudioDevice();

            this.synthesizer.SpeakCompleted += this.TTSCompleted;

            this.speakThread = new Thread(new ThreadStart(this.Speak));
            this.speakThread.SetApartmentState(ApartmentState.STA);
            this.speakThread.IsBackground = true;
            this.speakThread.Start();
        }
        public ParametersUpdater(SpeechRecognition sr, SkeletonFaceTracking st, TextToSpeech tts, MultiSourceImage msi, AudioFrame af, SpeechRecognitionView srv, SkeletonTrackingView stv, TextToSpeechView ttsv, RGBDplusMic rgbdmicv)
        {
            this.sr       = sr;
            this.st       = st;
            this.tts      = tts;
            this.msi      = msi;
            this.af       = af;
            this.srv      = srv;
            this.stv      = stv;
            this.ttsv     = ttsv;
            this.rgbdmicv = rgbdmicv;
            this.mw       = (MainWindow)Application.Current.MainWindow;

            this.responder = new NetworkResponder();
            this.responder.Bind("33412");

            this.json_thread = new Thread(new ThreadStart(this.ReceiveAndUpdate));
            this.json_thread.SetApartmentState(ApartmentState.STA);
            this.json_thread.IsBackground = true;
            this.json_thread.Start();
        }
        public MainWindow()
        {
            setKinectSensor();
            this.publisher = new NetworkPublisher();
            this.publisher.Bind("33405");
            this.subscriber = new NetworkSubscriber();
            this.subscriber.Bind("33406");
            this.colorPublisher = new NetworkPublisher();
            this.colorPublisher.Bind("33407");
            this.colorPublisher.SetConflate();
            this.depthPublisher = new NetworkPublisher();
            this.depthPublisher.Bind("33408");
            this.depthPublisher.SetConflate();
            this.audioPublisher = new NetworkPublisher();
            this.audioPublisher.Bind("33409");
            this.audioPublisher.SetConflate();
            this.mappingPublisher = new NetworkPublisher();
            this.mappingPublisher.Bind("33411");
            this.mappingPublisher.SetConflate();

            this.sr  = new SpeechRecognition(this.kinectSensor, this.publisher, this.convertStream);
            this.st  = new SkeletonTracking(this.kinectSensor, this.publisher);
            this.tts = new TextToSpeech(this.subscriber);
            this.af  = new AudioFrame(this.kinectSensor, this.audioPublisher);
            this.msi = new MultiSourceImage(this.kinectSensor, this.depthPublisher, this.colorPublisher, this.mappingPublisher);


            InitializeComponent();

            this.srv          = this.srview;
            this.stv          = this.stview;
            this.ttsv         = this.ttsview;
            this.rgbdplusmicv = this.rgbdmicview;

            // Need to create the responder after models because it's using instance of sr, srw, st & tts
            this.responder = new NetworkResponder();
            this.responder.Bind("33410");
        }