我正在使用Kinect开展语音识别项目,我想更改SpeechRecognitionEngine库中的语言。但是在我的机器上只安装了一种语言。
foreach (RecognizerInfo regInf in SpeechRecognitionEngine.InstalledRecognizers())
{
// regInf.Cultur -> returns "en-Us"
// regInf.Id -> returns "SR_MS_en-US_Kinect_11.0" and "SR_MS_ZXX_Lightweight_v11.0"
}
使用上面的代码我只得到“en-US”语言。那是件奇怪的事。因为我在使用Windows 7德语版的机器上工作。
如何安装德语进行语音识别?
答案 0 :(得分:0)
看起来您必须安装正确的识别文化部分。
请参阅http://msdn.microsoft.com/en-us/library/system.speech.recognition.recognizerinfo.aspx
private SpeechRecognitionEngine SelectRecognizer(CultureInfo requiredCulture, string requiredId)
{
// Select based on a specific recognizer configuration
SpeechRecognitionEngine speechRecognitionEngine=null;
foreach (RecognizerInfo config in SpeechRecognitionEngine.InstalledRecognizers())
{
if (config.Culture.Equals(requiredCulture) && config.Id== requiredId)
{
speechRecognitionEngine = new SpeechRecognitionEngine(config);
break;
}
}
return speechRecognitionEngine;
}
答案 1 :(得分:0)