1. Kinect 1.8 ShapeGame 無法中文辨識(已載入中文引擎)
2. 問題
private static RecognizerInfo GetKinectRecognizer()
{
Func<RecognizerInfo, bool> matchingFunc = r =>
{
string value;
r.AdditionalInfo.TryGetValue("Kinect", out value);
return "True".Equals(value, StringComparison.InvariantCultureIgnoreCase) && "en-US".Equals(r.Culture.Name, StringComparison.InvariantCultureIgnoreCase);
};
return SpeechRecognitionEngine.InstalledRecognizers().Where(matchingFunc).FirstOrDefault();
}
將en-US 改為 zh-TW 傳回 null
3. Check 我的系統有3個InstalledRecognizers, 第2個為zh-TW
4. 改用
return SpeechRecognitionEngine.InstalledRecognizers()[1];
可進行中文辨識。
5. 或改用
private static RecognizerInfo GetKinectRecognizer()
{
RecognizerInfo SPE = SpeechRecognitionEngine.InstalledRecognizers()[0];
for (int i = 0; i < SpeechRecognitionEngine.InstalledRecognizers().Count; i++)
{
if (SpeechRecognitionEngine.InstalledRecognizers()[i].Culture.Name == "zh-TW")
{
SPE = SpeechRecognitionEngine.InstalledRecognizers()[i];
break;
}
}
return SPE;
}