如果语音识别语言设置为英语 - 美国以外的任何其他语言,则不加载程序

时间:2013-04-25 18:04:54

标签: c# visual-studio .net-4.0 voice-recognition

我在程序中添加了语音识别功能。但是,如果我尝试运行该程序并且语音属性中的语言设置为“Microsoft Speech Recognizer 8.0 for Windows(英语 - 美国)”以外的任何其他语言,则程序无法加载。

我想拥有它,无论选择哪种语言,程序都会加载。

我的语音命令代码如下:

vcstat.Text = "Voice Control Enabled";
            recognizer = new SpeechRecognizer();
            recognizer.SpeechDetected += recognizer_SpeechDetected;
            recognizer.SpeechRecognitionRejected += recognizer_SpeechRecognitionRejected;
            recognizer.SpeechRecognized += recognizer_SpeechRecognized;  
        GrammarBuilder grammar = new GrammarBuilder();
            grammar.Append(new Choices("Cut", "Copy", "Paste", "Select All Text", "Print", "Unselect All Text", "Delete", "Save", "Save As", "Open", "New", "Close Basic Word Processor"));
            recognizer.LoadGrammar(new Grammar(grammar));

还有一些代码,但这与实际命令有关,所以我认为没有必要在这里发布。

如果有人可以帮我找出一种允许程序启动的方法,无论使用何种语音识别引擎,我都会非常感激。

1 个答案:

答案 0 :(得分:0)

如果在客户端计算机上为某种受支持的语言安装了MUI语言包,则只能使用其他语言进行语音识别。

http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/windows-7-speech-recognition-language-selection/0a859099-a76d-4799-abe9-847997399927