Question

Right now, say I have created a Grammar which have the following elements in it

have, nice, day, they

What I'm trying to do here is, when I say "have", the result of the recognition is "have". When I say "have nice", the result will be "have nice".

How can I append these 2 choices or more into a single result of recognition?

And also, is it possible to add my own words to the DictationGrammar?

Was it helpful?

Solution

First - you can build repeated elements using this GrammarBuilder constructor: GrammarBuilder (GrammarBuilder, Int32, Int32).

Second, you can add words to the dictation grammar using Lexicons. Unfortunately, the lexicon interfaces in SAPI are not exposed via System.Speech.Recognition, so your choices are either to use C++ and native SAPI, or to use Speechlib and the SAPI automation wrappers.

Alternatively, if you don't need to do this via code, you can use the speech dictionary that's part of Windows Speech Recognition.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top