public void EnableVoiceRecognition() { if (kinectSensor != null) { cell = new AudioCell(); kinectSpeechListener = new AudioListener(cell, kinectSensor.AudioSource); listener = new Thread(new ThreadStart(kinectSpeechListener.Listen)); listener.Start(); speechEnabled = true; } }
public void DisableVoiceRecognition() { if (speechEnabled) { listener.Abort(); listener.Join(); cell = null; kinectSpeechListener = null; listener = null; speechEnabled = false; } }
public AudioListener(AudioCell c, KinectAudioSource audioSource) { ri = GetKinectRecognizer(); cell = c; c.Initialize(ri.Culture); source = audioSource; }