I am using c# and the windows speech recognition in order to communicate with my program. The only word to be recognized is “Yes”, this works fine in my program the only problem is that since the speech recognition is activated it will type in what ever I am saying is there a way to limit the speech recognition program to only recognize one word, in this case the word “yes”?
Thank you
What do you mean “since the speech recognition is activated it will type in what ever I am saying”? Are you saying that the desktop recognizer continues to run and handle commands? Perhaps you should be using an inproc recognizer rather than the shared recognizer (see Using System.Speech.Recognition opens Windows Speech Recognition)
Are you using a dictation grammar? If you only want to recognize a limited set of words or commands, do not use the dictation grammar. Use a GrammarBuilder (or similar) and create a simple grammar. See http://msdn.microsoft.com/en-us/library/hh361596
There is a very good article that was published a few years ago at http://msdn.microsoft.com/en-us/magazine/cc163663.aspx. It is probably the best introductory article I’ve found so far. It is a little out of date, but very helfpul. (The AppendResultKeyValue method was dropped after the beta.) Look at the examples of how they build the grammars for ordering Pizza.
One thing to keep in mind, a grammar with one word may show many false positives (since the recognizer will try to match to something in your grammar). You may want to put in at lest Yes and No so it can have something to compare to.