Compartilhar via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Prepare Grammar Command-Line Syntax

The command-line syntax for PrepareGrammar.exe has the following format.

PrepareGrammar /In <input file name> /Out <output file name> /RecoConfig <configuration file name>

The following table describes the command-line option names and values for Prepare Grammar.

Option Name

Description

/In

Required. The file name and extension of a compiled grammar file, for example "MyGrammar.cfg".

/Out

Required. The file name and extension of the prepared grammar file, for example "MyGrammar.cfgpp". Files of the CFGPP format are optimized for a specific instance of a speech engine.

/RecoConfig

Optional. The name of the configuration file to use for the speech recognition engine. If not specified, the tool will look for a default configuration file named “RecoConfig.xml” in the current working directory and in the directory that contains PrepareGrammar.exe. The tool will generate an error if you do not supply it with a configuration file.

/?

Optional. Displays a list of acceptable option/value pairs.

Note

  • Command-line options and values are not case-sensitive.

  • Command-line options can be preceded by a forward slash (0x002F), a dash (0x002d), an en dash (0x2013), an em dash (0x2014), or a horizontal bar (0x2015).

  • You can enter option/value pairs in any sequence.

Warning

If an existing file has the same name as the file name specified by the /Out option, it will be overwritten. The tool does not warn that a file will be overwritten.

You must either specify a recognition engine configuration file using the /RecoConfig option, or create a default configuration file named "RecoConfig.xml" either in the current directory (the directory for the command line) or in the directory that contains PrepareGrammar.exe. Use the configuration file to specify a speech recognition engine to use, to configure the parameters for connecting to it, and to configure its behavior. For more information, see Setting Up the Grammar Development Tools.

Example

The following is an example command-line entry for PrepareGrammar.exe.

PrepareGrammar -In InputFile.cfg -Out OutputFile.cfgpp -RecoConfig ConfigFile.xml