private void Start() { var audioSource = this.kinect.AudioSource; //audioSource.BeamAngleMode = BeamAngleMode.Adaptive; var kinectStream = audioSource.Start(); this.stream = new EnergyCalculatingPassThroughStream(kinectStream); this.speechRecognizer.SetInputToAudioStream( this.stream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); this.speechRecognizer.RecognizeAsync(RecognizeMode.Multiple); //var t = new Thread(this.PollSoundSourceLocalization); //t.Start(); }
/// <summary> /// method to start the audio stream /// </summary> private void StartAudioStream() { AudioSource.BeamAngleMode = BeamAngleMode.Adaptive; AudioSource.EchoCancellationMode = EchoCancellationMode.CancellationAndSuppression; var kinectStream = AudioSource.Start(); this.stream = new EnergyCalculatingPassThroughStream(kinectStream); this.speechRecognizer.SetInputToAudioStream( this.stream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); this.speechRecognizer.RecognizeAsync(RecognizeMode.Multiple); LogHelper.logInput("Audio stream started", LogHelper.logType.INFO, this); var t = new Thread(this.GetEnergyFromStream); t.Start(); }
private void Start() { var audioSource = this.kinect.AudioSource; audioSource.BeamAngleMode = BeamAngleMode.Adaptive; var kinectStream = audioSource.Start(); this.stream = new EnergyCalculatingPassThroughStream(kinectStream); this.speechRecognizer.SetInputToAudioStream( this.stream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); this.speechRecognizer.RecognizeAsync(RecognizeMode.Multiple); }
private void ReadyTimerTick(object sender, EventArgs e) { //this.Start(); //speech_status_icon.Source = new BitmapImage(new Uri("./Resources/images/mic_ready.png", UriKind.Relative)); //status_block.Text = "Alright, Hit Me!"; this.readyTimer.Stop(); this.readyTimer = null; changeState(SRStates.LISTENING); var audioSource = _sensor.AudioSource; //audioSource.BeamAngleMode = BeamAngleMode.Adaptive; var kinectStream = audioSource.Start(); this.stream = new EnergyCalculatingPassThroughStream(kinectStream); this.speechRecognizer.SetInputToAudioStream( this.stream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); this.speechRecognizer.RecognizeAsync(RecognizeMode.Multiple); }
public override void Start() { sre = CreateSpeechRecognizer(); object s = ReflectionUtilities.InvokeProperty(device, "AudioStream"); if (s == null) { Console.WriteLine("Unable to generate audio stream."); return; } Console.WriteLine("Welcome to the Audio Gesture recognition module."); Console.WriteLine("I can recognize the following words:"); foreach (string w in words) { Console.WriteLine("\t{0}", w); } this.stream = new EnergyCalculatingPassThroughStream((Stream)s); this.sre.SetInputToAudioStream( this.stream, new Microsoft.Speech.AudioFormat.SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); this.sre.RecognizeAsync(RecognizeMode.Multiple); }
private void Start() { try { kinectSource = new KinectAudioSource(); kinectSource.SystemMode = SystemMode.OptibeamArrayOnly; kinectSource.FeatureMode = true; kinectSource.AutomaticGainControl = false; //kinectSource.Noi kinectSource.MicArrayMode = MicArrayMode.MicArrayAdaptiveBeam; var kinectStream = kinectSource.Start(); stream = new EnergyCalculatingPassThroughStream(kinectStream); sre.SetInputToAudioStream(stream, new SpeechAudioFormatInfo( EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); sre.RecognizeAsync(RecognizeMode.Multiple); var t = new Thread(PollSoundSourceLocalization); t.Start(); } catch { MessageBox.Show( @"There was a problem initializing the KinectAudioSource. Ensure you have the Kinect SDK installed correctly.", "Failed to load Speech SDK", MessageBoxButton.OK, MessageBoxImage.Error); this.Close(); } }