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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.