示例#1
0
 public void Dispose()
 {
     _audioEncoder.Dispose();
     _videoEncoder.Dispose();
     if (_audio != null)
     {
         _audio.Dispose();
     }
 }
示例#2
0
 public void Stop()
 {
     if (sre != null)
     {
         sre.RecognizeAsyncCancel();
         sre.RecognizeAsyncStop();
         kinectSource.Dispose();
     }
 }
示例#3
0
 public void Stop()
 {
     if (sre != null)
     {
         kinectAudioSource.Stop();
         sre.RecognizeAsyncCancel();
         sre.RecognizeAsyncStop();
         kinectAudioSource.Dispose();
     }
     if (speech != null)
     {
         speech = null;
     }
 }
示例#4
0
        public void Cleanup()
        {
            if (speechRecognitionEngine != null)
            {
                speechRecognitionEngine.UnloadAllGrammars();
                speechRecognitionEngine.Dispose();
                speechRecognitionEngine = null;
            }

            if (kinectAudioSource != null)
            {
                kinectAudioSource.Stop();
                kinectAudioSource.Dispose();
                kinectAudioSource = null;
            }
        }
        private void Window_Closed(object sender, EventArgs e)
        {
            // audio stop

            sre.RecognizeAsyncCancel();
            sre.RecognizeAsyncStop();
            audioStream.Close();
            audioStream.Dispose();
            audioSource.Dispose();

            // server stop

            server.Stop();

            // kinect stop

            nui.Uninitialize();

            // exit

            Environment.Exit(0);
        }