简体   繁体   English

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

[英]Program does not load if Speech Recognition Language is set to anything other than English - US

I have added a speech recognition feature to my program. 我已经在程序中添加了语音识别功能。 However, if I try to run the program and the language in the Speech Properties is set to anything other than "Microsoft Speech Recognizer 8.0 for Windows (English - US), the program fails to load. 但是,如果我尝试运行该程序,并且“语音属性”中的语言设置为“用于Windows的Microsoft Speech Recognizer 8.0(英语-美国)”以外的其他语言,则该程序无法加载。

I would like to have it so that the program will load no matter which language is selected. 我想拥有它,以便无论选择哪种语言,程序都将加载。

The code for my voice command is as follows: 我的语音命令的代码如下:

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));

There is some more code, but that's to do with the actual commands, so I don't think it's necessary to post it here. 还有更多代码,但这与实际命令有关,因此我认为没有必要在此处发布。

If somebody could help me figure out a way to allow the program to start, regardless of the Speech Recognition Engine in use, I'd really appreciate it. 如果有人可以帮助我找出允许程序启动的方法,而不管使用的是语音识别引擎,我将不胜感激。

You can only use Speech Recognition in a different language if a MUI language pack is installed on the client's computer for one of the supported languages. 如果客户端计算机上为支持的一种语言安装了MUI语言包,则只能使用其他语言的语音识别。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM