Natural User Interface (NUI) Speech Grammars

A grammar defines the words and phrases that an application will recognize in speech input. Grammars are at the core of speech recognition and are perhaps the most important factor under your control that influences the accuracy of speech recognition.

Use different types of grammars to enable your application to perform speech recognition:

Which grammar type you use may depend on the complexity of the recognition experience you want to create and your level of expertise in creating grammars. Any one approach may be the best choice for a specific recognition task, and you may find uses for all types of grammars in your application.

Beginning with the August 2013 XDK, the speech engine for Xbox One cannot directly consume a GRXML grammar file. Titles must use the CFG (compiled binary grammar) format. GRXMLs can continue to be used during development; you can generate CFG files via either the command-line grammar compiler tool (xbpg.exe) or automatically via SpeechLab. Titles can continue to use the GrammarBuilder() APIs to programmatically generate grammars at runtime.

Programmatic list grammars

Programmatic list grammars provide a lightweight approach to creating a simple grammar as a list of phrases. A list grammar consists of an array of strings that represents speech input that your application will accept for a recognition operation. Create list grammars inside your application by passing an array of strings to the SpeechGrammarSet.AddGrammarFromList method. Recognition is successful when the speech recognizer recognizes any one of the strings in the array.

List grammars are best suited to simple recognition scenarios. For greater authoring flexibility in more complex recognition scenarios, use SRGS grammars.

SRGS grammars

Unlike a programmatic list grammar, author an SRGS grammar as a static document using the XML format defined by the Speech Recognition Grammar Specification (SRGS) Version 1.0. The XML schema for SRGS provides a powerful set of tools to create grammars for speech recognition scenarios ranging from basic to complex.