How Tos

Last reviewed: 7/15/2015

Article ID: H061406

HOW: Using command IDs with speech recognition

The information in this article applies to:

  • SpeechKit 8

Summary

Process recognition results using command identifiers in addition to command strings.

More Information

A command can optionally have a numeric identifier associated with it. This enables processing recognition results on the basis of a numeric identifier in addition to command strings.

If and identifier is not specified, the command position in the list is the default numeric value is assigned.

To create a command vocabulary, instantiate a ChantCommandVocab class object. Then add the commands.

// Define the vocabulary
NChantCommandVocab nChantCommandVocab = nChantSR.CreateChantCommandVocab("commands");

// Add commands to the vocabulary
nChantCommandVocab.AddCommand("Open File", 101);
nChantCommandVocab.AddCommand("Print File", 102);
nChantCommandVocab.AddCommand("Close File", 103);

// Enable the vocabulary
nChantCommandVocab.Enable();

// Disable the vocabulary
nChantCommandVocab.Disable();