Hello!!!
We asked for it, and now we finally have weekly builds for the new Kinect V2 SDK. Now the interesting thing is that we have tons of interesting work in each release to review what you have inside. So today, a small review of something that already exists in Kinect SDK V1.8 and needed in V2: Speech Recognition.
The basis is simple and safe that you know, create a dictionary with words within the same. The interesting thing is that we make the Association of the audio feed of Kinect with the speech grammar defined in line 5 in line 18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void WindowLoaded(object sender, RoutedEventArgs e) | |
| { | |
| kinectSensor = KinectSensor.GetDefault(); | |
| kinectSensor.Open(); | |
| var audioBeamList = kinectSensor.AudioSource.AudioBeams; | |
| var audioStream = audioBeamList[0].OpenInputStream(); | |
| convertStream = new KinectAudioStream(audioStream); | |
| Var ri = GetKinectRecognizer(); | |
| recognitionSpans = new List<Span> { forwardSpan, backSpan, rightSpan, leftSpan }; | |
| speechEngine = new SpeechRecognitionEngine(ri.Id); | |
| // Create a grammar definition … | |
| speechEngine.SpeechRecognized += SpeechRecognized; | |
| speechEngine.SpeechRecognitionRejected += SpeechRejected; | |
| convertStream.SpeechActive = true; | |
| speechEngine.SetInputToAudioStream( | |
| convertStream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null)); | |
| speechEngine.RecognizeAsync(RecognizeMode.Multiple); | |
| } | |
| private static RecognizerInfo GetKinectRecognizer() | |
| { | |
| foreach (RecognizerInfo recognizer in SpeechRecognitionEngine.InstalledRecognizers()) | |
| { | |
| string value; | |
| recognizer.AdditionalInfo.TryGetValue("Kinect", out value); | |
| if ("True".Equals(value, StringComparison.OrdinalIgnoreCase) && "en-US".Equals(recognizer.Culture.Name, StringComparison.OrdinalIgnoreCase)) | |
| { | |
| return recognizer; | |
| } | |
| } | |
| return null; | |
| } |
Another important point is the section for the KinectRecognizer at the end. To see if when I arrive to Madrid I make a cool video 😀
And as always, the disclaimer
“This is preliminary software and/or hardware and APIs are preliminary and subject to change”
Greetings @AVE
El Bruno
Leave a reply to elbruno Cancel reply