How do I 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();
// Define the vocabulary
CChantCommandVocab* pChantCommandVocab = pChantSR->CreateChantCommandVocab(L"commands");
// Add commands to the vocabulary
pChantCommandVocab->AddCommand(L"Open File");
pChantCommandVocab->AddCommand(L"Print File");
pChantCommandVocab->AddCommand(L"Close File");
// Enable the vocabulary
pChantCommandVocab->Enable();
// Disable the vocabulary
pChantCommandVocab->Disable();
// Define the vocabulary
CChantCommandVocab* pChantCommandVocab = pChantSR->CreateChantCommandVocab("commands");
// Add commands to the vocabulary
pChantCommandVocab->AddCommand("Open File");
pChantCommandVocab->AddCommand("Print File");
pChantCommandVocab->AddCommand("Close File");
// Enable the vocabulary
pChantCommandVocab->Enable();
// Disable the vocabulary
pChantCommandVocab->Disable();
var aTChantCommandVocab: TChantCommandVocab;
// Define the vocabulary
aTChantCommandVocab := aTChantSR.CreateChantCommandVocab('commands');
// Add commands to the vocabulary
aTChantCommandVocab.AddCommand('Open File');
aTChantCommandVocab.AddCommand('Print File');
aTChantCommandVocab.AddCommand('Close File');
// Enable the vocabulary
aTChantCommandVocab.Enable();
// Disable the vocabulary
aTChantCommandVocab.Disable();
// Define the vocabulary
JChantCommandVocab jChantCommandVocab = jChantSR.createChantCommandVocab("commands");
// Add commands to the vocabulary
jChantCommandVocab.addCommand("Open File");
jChantCommandVocab.addCommand("Print File");
jChantCommandVocab.addCommand("Close File");
// Enable the vocabulary
jChantCommandVocab.enable();
// Disable the vocabulary
jChantCommandVocab.disable();
' Define the vocabulary
Dim nChantCommandVocab As 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();
// Define the vocabulary
CChantDictationVocab* pChantDictationVocab = pChantSR->CreateChantDictationVocab(L"text");
// Enable the vocabulary
pChantDictationVocab->Enable();
// Disable the vocabulary
pChantDictationVocab->Disable();
// Define the vocabulary
CChantDictationVocab* pChantDictationVocab = pChantSR->CreateChantDictationVocab("text");
// Enable the vocabulary
pChantDictationVocab->Enable();
// Disable the vocabulary
pChantDictationVocab->Disable();
var aTChantDictationVocab: TChantDictationVocab;
// Define the vocabulary
aTChantDictationVocab := aTChantSR.CreateChantDictationVocab('text');
// Enable the vocabulary
aTChantDictationVocab.Enable();
// Disable the vocabulary
aTChantDictationVocab.Disable();
// Define the vocabulary
JChantDictationVocab jChantDictationVocab = jChantSR.createChantDictationVocab("text");
// Enable the vocabulary
jChantDictationVocab.enable();
// Disable the vocabulary
jChantDictationVocab.disable();
' Define the vocabulary
Dim nChantDictationVocab As 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();
// Voice enable the textbox with Dragon dictation session
CChantDragonCustom* pDragonBoxResource = pChantSR->CreateChantDragonCustom(pEdit->GetSafeHwnd(), GetSafeHwnd(), 0);
// Enable dictation
pDragonBoxResource->Enable();
// Disable dictation
pDragonBoxResource->Disable();
// Voice enable the textbox with Dragon dictation session
CChantDragonCustom* pDragonBoxResource = pChantSR->CreateChantDragonCustom(Memo1->Handle, Form1->Handle, 0);
// Enable dictation
pDragonBoxResource->Enable();
// Disable dictation
pDragonBoxResource->Disable();
var aTChantDragonCustom: TChantDragonCustom;
// Voice enable the textbox with Dragon dictation session
aTChantDragonCustom := aTChantSR.CreateChantDragonCustom(Memo1.Handle, Handle, 0);
// Enable dictation
aTChantDragonCustom.Enable();
// Disable dictation
aTChantDragonCustom.Disable();
Not supported.
' Voice enable the textbox with Dragon dictation session
Dim nDragonBoxResource As NChantDragonCustom
nDragonBoxResource = nChantSR.CreateChantDragonCustom(TextBox1, Me, 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();
// Voice enable the textbox with Dragon dictation session
CChantDragonEdit* pDragonBoxResource = pChantSR->CreateChantDragonEdit(pEdit->GetSafeHwnd(), GetSafeHwnd(), 0);
// Enable dictation
pDragonBoxResource->Enable();
// Disable dictation
pDragonBoxResource->Disable();
// Voice enable the textbox with Dragon dictation session
CChantDragonEdit* pDragonBoxResource = pChantSR->CreateChantDragonEdit(Memo1->Handle, Form1->Handle, 0);
// Enable dictation
pDragonBoxResource->Enable();
// Disable dictation
pDragonBoxResource->Disable();
var aTChantDragonEdit: TChantDragonEdit;
// Voice enable the textbox with Dragon dictation session
aTChantDragonEdit := aTChantSR.CreateChantDragonEdit(Memo1.Handle, Handle, 0);
// Enable dictation
aTChantDragonEdit.Enable();
// Disable dictation
aTChantDragonEdit.Disable();
Not supported.
' Voice enable the textbox with Dragon dictation session
Dim nDragonBoxResource As NChantDragonEdit
nDragonBoxResource = nChantSR.CreateChantDragonEdit(TextBox1, Me, 0)
' Enable dictation
nDragonBoxResource.Enable()
' Disable dictation
nDragonBoxResource.Disable()