我无法在sime时间让kinect sdk进行语音识别和跟踪骨骼数据 [英] I can't get kinect sdk to do speech recognition and track skeletal data at the sime time
问题描述
我在女巫中有一个程序,可以通过它启用语音识别..
I' ve a program in witch I enabled speech recognition with..
RecognizerInfo ri = GetKinectRecognizer();
speechRecognitionEngine = new SpeechRecognitionEngine(ri.Id);
// Create a grammar from grammar definition XML file.
using (var memoryStream = new MemoryStream(Encoding.ASCII.GetBytes(fileContent)))
{
var g = new Grammar(memoryStream);
speechRecognitionEngine.LoadGrammar(g);
}
speechRecognitionEngine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(speechEngine_SpeechRecognized);
speechRecognitionEngine.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(speechEngine_SpeechRecognitionRejected);
speechRecognitionEngine.SetInputToAudioStream( sensor.AudioSource.Start(),新的SpeechAudioFormatInfo(EncodingFormat.Pcm,16000,16,1,32000,2,null));
speechRecognitionEngine.SetInputToAudioStream( sensor.AudioSource.Start(), new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000, 16, 1, 32000, 2, null));
speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);
..
一切正常,SpeechRecognized事件被正确触发..
all'is working fine and SpeechRecognized event get fired correctly..
问题是,当我启用骨骼数据跟踪时,
The problem is, when I anable skeletal data tracking,
sensor.SkeletonStream.Enable();
sensor.SkeletonStream.TrackingMode = SkeletonTrackingMode.Seated;
sensor.SkeletonFrameReady += sensor_SkeletonFrameReady;
语音识别停止工作...
speech recognition stops working ...
我能得到您的帮助吗?
非常感谢您!
推荐答案
如果在开始音频捕获后启用了骨架流,则不会处理音频 由于存在错误,启用或禁用SkeletonStream会停止Kinect传感器返回的AudioSource流.以下指令序列将停止音频流: kinectSensor.Start(); kinectSensor.AudioSource.Start(); //->这将创建音频流 kinectSensor.SkeletonStream.Enable(); //->这将停止音频流,这是不希望的副作用
Audio is not processed if skeleton stream is enabled after starting audio capture Due to a bug, enabling or disabling the SkeletonStream will stop the AudioSource stream returned by the Kinect sensor. The following sequence of instructions will stop the audio stream: kinectSensor.Start(); kinectSensor.AudioSource.Start(); // --> this will create an audio stream kinectSensor.SkeletonStream.Enable(); // --> this will stop the audio stream as an undesired side effect
解决方法是在更改SkeletonStream状态后反转呼叫顺序或重新启动AudioSource.
The workaround is to invert the order of the calls or to restart the AudioSource after changing SkeletonStream status.
Workaround #1 (start audio after skeleton):
kinectSensor.Start();
kinectSensor.SkeletonStream.Enable();
kinectSensor.AudioSource.Start();
Workaround #2 (restart audio after skeleton):
kinectSensor.Start();
kinectSensor.AudioSource.Start(); // --> this will create an audio stream
kinectSensor.SkeletonStream.Enable(); // --> this will stop the audio stream as an undesired side effect
kinectSensor.AudioSource.Start(); // --> this will create another audio stream
来源- http://msdn.microsoft.com/en-us/library/jj663798.aspx
这篇关于我无法在sime时间让kinect sdk进行语音识别和跟踪骨骼数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!