Use a String to Create a GrammarBuilder (Microsoft.Speech)

Microsoft Speech Platform SDK 11

Collapse image Expand Image Copy image CopyHover image

You can use GrammarBuilder to create a simple grammar that will recognize a single word or short phrase. When a user of your application speaks the word or phrase, the speech recognition engine performs recognition by matching the user's utterance to phrase defined by the GrammarBuilder.

The following code fragment uses the GrammarBuilder(String) constructor to create a recognizable phrase from a string:

C#  Copy imageCopy Code
GrammarBuilder gb = new GrammarBuilder("one two three");

Strings serve as a starting point for building complex grammars using the methods and constructors on the GrammarBuilder class.

See Also