Developing applications that recognize speech with Dragon NaturallySpeaking 15

Last reviewed: 11/1/2016

HOW Article ID: H111606

The information in this article applies to:

  • Chant Developer Workbench 2016
  • SpeechKit 8

Summary

Chant Developer Workbench supports recognizing speech with Dragon NaturallySpeaking 15.

More Information

Chant Developer Workbench supports recognizing commands and continuous speech with Dragon NaturallySpeaking 15.

The SpeechKit vocabulary classes ChantCommandVocab and ChantDictationVocab are used to manage command and continuous speech recognition. Refer to the Class Library Reference in the help file and explore the Command and Dictation project samples to discover more capabilities supported by these classes.

The following example illustrates using a command vocabulary.


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

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

// Enable the vocabulary
nChantCommandVocab.Enable();

// Disable the vocabulary
nChantCommandVocab.Disable();

The following example illustrates using a dictation vocabulary.


// Define the vocabulary
NChantDictationVocab nChantDictationVocab = nChantSR.CreateChantDictationVocab("text");
 
// Enable the vocabulary
nChantDictationVocab.Enable();

// Disable the vocabulary
nChantDictationVocab.Disable();

An alternative to managing the speech recognition in your application is to use the SpeechKit ChantDragonCustom and ChantDragonEdit that map Windows text controls directly to the Dragon speech recognition engine.

The following example illustrates voice enabling a Dragon NaturallySpeaking custom edit control.


// Voice enable the textbox with Dragon dictation session
NChantDragonCustom nDragonBoxResource = nChantSR.CreateChantDragonCustom(textBox1, this, 0);

// Enable dictation
nDragonBoxResource.Enable();

// Disable dictation
nDragonBoxResource.Disable();

The following example illustrates voice enabling a Dragon NaturallySpeaking custom edit control.


// Voice enable the textbox with Dragon dictation session
NChantDragonEdit nDragonBoxResource = nChantSR.CreateChantDragonEdit(textBox1, this, 0);

// Enable dictation
nDragonBoxResource.Enable();

// Disable dictation
nDragonBoxResource.Disable();