Last reviewed: 3/23/2024 9:36:43 AM
Creating, Deleting, Training, and Persisting Profiles
The ProfileKit management class is designed to provide you a lot of flexiblity and minimize the programming necessary to manage profiles. You can easily create, delete, and train speaker profiles.
To create a speaker with Microsoft SAPI 5, use the CreateSpeaker method. If the speaker doesn't exist for this recognizer, it is created.
// Instantiate ProfileKit object
_ProfileKit = new NProfileKit();
if (_ProfileKit != null)
{
// Set credentials
_ProfileKit.SetCredentials("Credentials");
_Recognizer = _ProfileKit.CreateSAPI5Recognizer();
if (_Recognizer != null)
{
// Create a new speaker profile
_Recognizer.CreateSpeaker("NewUser");
_Recognizer.Dispose();
}
_ProfileKit.Dispose();
}
// Instantiate ProfileKit object
_ProfileKit = new CProfileKit();
if (_ProfileKit != NULL)
{
// Set credentials
_ProfileKit->SetCredentials(L"Credentials");
_Recognizer = _ProfileKit->CreateSAPI5Recognizer();
if (_Recognizer != NULL)
{
// Create a new speaker profile
_Recognizer->CreateSpeaker(L"NewUser");
delete _Recognizer;
}
_delete ProfileKit;
}
// Instantiate ProfileKit object
_ProfileKit = new CProfileKit();
if (_ProfileKit != NULL)
{
// Set credentials
_ProfileKit->SetCredentials("Credentials");
_Recognizer = _ProfileKit->CreateSAPI5Recognizer();
if (_Recognizer != NULL)
{
// Create a new speaker profile
_Recognizer->CreateSpeaker("NewUser");
_Recognizer->Dispose();
}
_ProfileKit.Dispose();
}
// Instantiate ProfileKit object
_ProfileKit := TProfileKit.Create();
if (_ProfileKit <> nil) then
begin
// Set credentials
_ProfileKit.SetCredentials('Credentials');
_Recognizer := _ProfileKit.CreateSAPI5Recognizer();
if (_Recognizer <> nil) then
begin
// Create a new speaker profile
_Recognizer.CreateSpeaker('NewUser');
_Recognizer.Destroy();
end;
_ProfileKit.Destroy();
end;
// Instantiate ProfileKit object
_ProfileKit = new JProfileKit();
if (_ProfileKit != null)
{
// Set credentials
_ProfileKit.setCredentials("Credentials");
_Recognizer = _ProfileKit.createSAPI5Recognizer();
if (_Recognizer != null)
{
// Create a new speaker profile
_Recognizer.createSpeaker("NewUser");
_Recognizer.dispose();
}
_ProfileKit.dispose();
}
' Instantiate ProfileKit object
_ProfileKit = New NProfileKit();
If (_ProfileKit IsNot Nothing) Then
' Set credentials
_ProfileKit.SetCredentials("Credentials")
_Recognizer = _ProfileKit.CreateSAPI5Recognizer()
If (_Recognizer IsNot Nothing) Then
' Create a new speaker profile
_Recognizer.CreateSpeaker("NewUser")
_Recognizer.Dispose()
End If
_ProfileKit.Dispose()
End If
To delete a speaker, invoke the Delete method.
// Delete the speaker
_Recognizer.DeleteSpeaker("NewUser");
// Delete the speaker
_Recognizer->DeleteSpeaker(L"NewUser");
// Delete the speaker
_Recognizer->DeleteSpeaker("NewUser");
// Delete the speaker
_Recognizer.DeleteSpeaker('NewUser');
// Delete the speaker
_Recognizer.deleteSpeaker("NewUser");
' Delete the speaker
_Recognizer.DeleteSpeaker("NewUser")
To create and delete a speaker with Nuance Dragon NaturallySpeaking, use the ManageUsers dialog.
To train a speaker with the recognizer supplied dialog, select the recognizer with SetEngine, select the speaker profile with SetSpeaker, and invoke the ShowDialog method to dispay the MicTraining and UserTraining dialogs.
To determine if a dialog is available, invoke the IsSupported method.
To display a dialog, invoke the ShowDialog method.
bool isSupported = _Recognizer.IsSupported("MicTraining");
if (isSupported)
{
_Recognizer.ShowDialog("MicTraining", new System.Windows.Interop.WindowInteropHelper(this).Handle, string.Empty, string.Empty);
}
isSupported = _Recognizer.IsSupported("UserTraining");
if (isSupported)
{
_Recognizer.ShowDialog("UserTraining", new System.Windows.Interop.WindowInteropHelper(this).Handle, string.Empty, string.Empty);
}
bool isSupported = _Recognizer->IsSupported(L"MicTraining");
if (isSupported)
{
_Recognizer->ShowDialog(L"MicTraining", GetSafeHwnd(), L"", L"");
}
isSupported = _Recognizer->IsSupported(L"UserTraining");
if (isSupported)
{
_Recognizer->ShowDialog(L"UserTraining", GetSafeHwnd(), L"", L"");
}
bool isSupported = _Recognizer->IsSupported("MicTraining");
if (isSupported)
{
_Recognizer->ShowDialog("MicTraining", Form1->Handle, "", "");
}
isSupported = _Recognizer->IsSupported("UserTraining");
if (isSupported)
{
_Recognizer->ShowDialog("UserTraining", Form1->Handle, "", "");
}
var
isSupported: Boolean;
isSupported := _Recognizer.IsSupported("MicTraining");
if (isSupported) then
begin
_Recognizer.ShowDialog("MicTraining", Form1.Handle, '', '');
end;
isSupported := _Recognizer.IsSupported("UserTraining");
if (isSupported) then
begin
_Recognizer.ShowDialog("UserTraining", Form1.Handle, '', '');
end;
Boolean isSupported = _Recognizer.isSupported("MicTraining");
if (isSupported)
{
_Recognizer.showDialog("MicTraining");
}
isSupported = _Recognizer.isSupported("UserTraining");
if (isSupported)
{
_Recognizer.showDialog("UserTraining");
}
Dim isSupported As Boolean
isSupported = _Recognizer.IsSupported("MicTraining")
If (isSupported) Then
_Recognizer.ShowDialog("MicTraining", New System.Windows.Interop.WindowInteropHelper(Me).Handle, string.Empty, string.Empty);
End If
isSupported = _Recognizer.IsSupported("UserTraining")
If (isSupported) Then
_Recognizer.ShowDialog("UserTraining", New System.Windows.Interop.WindowInteropHelper(Me).Handle, string.Empty, string.Empty);
End If
SAPI5 Dialog | Description |
---|---|
RecoProfileProperties | View the speaker profile properties |
UserTraining | Train the speaker profile |
MicTraining | Adjust microphone settings |
Dragon NaturallySpeaking Dialog | |
About | Displays the Dragon NaturallySpeaking About dialog box |
AccuracyAssistant | Displays the Accuracy Assistant that helps users determine what tool to use to improve the recognition accuracy of their system by asking a series of questions and, depending on the answers, providing links to the proper tool |
AccuracyCenter | Displays the Accuracy Center that provides a central location for taking advantage of all the available tools for improving recognition accuracy |
AddWord | Displays the Add Word dialog box |
AddWordFromList | Displays the Import Words from list dialog box that enables users to add words from lists to their vocabulary |
AddWordsFromDocs | Displays the Add Words from Documents dialog box |
AudioSetupWizard (MicTraining) | Runs the Audio Setup wizard to perform additional tuning of the audio settings |
CommandBrowser | Displays the Command Browser used to view and train commands, create and modify commands, import and export commands, and change the availability of custom commands |
DictationShortcuts | Displays the MyCommands Editor to create and edit voice commands |
EditCommandWizard | Displays the MyCommands Editor to create and edit voice commands |
EngineProperties | Displays the Dragon NaturallySpeaking Options dialog box |
FormattingOptions | Displays the Dragon Auto-Formatting Options dialog box, where users set preferences for standard formatting that Dragon should apply to all recognized text, including formats for web and street addresses, titles such as "Mr.", dates and times, contractions, spelled out numbers versus numerals, ISO currency codes, phone numbers, prices, postal codes, social security numbers, automatic punctuation, and one or two spaces after a period |
GeneralTraining (UserTraining) | Runs General Training to perform additional training of the user |
HelpTopics | Displays the Dragon NaturallySpeaking Help viewer |
ImportDVC | Displays the Import Command Files dialog box |
ManageUsers | Displays the Manage Users dialog box to create, edit, and delete users |
MobileTraining | Runs supplemental Mobile Training |
NewCommandWizard | Runs the MyCommands Editor to create voice commands |
NewVocabulary | Displays the New Vocabulary dialog box |
OpenVocabulary | Displays the Manage Vocabularies dialog box |
PerformanceAssistant | Displays the Performance Assistant Help file |
RecognitionHistory | Displays the Recognition History dialog box |
RemoveDVC | Displays the Delete Command Files dialog box |
RoamingUsersOptions | Displays the Administrative Settings dialog box that contains Roaming User options |
SpeakerNew | Starts the New User wizard. Specify this ID when you want to create a user and run first-time audio setup and General Training |
SpeakerOpen | Displays the Manage Users dialog and then starts the New User wizard if the selected user is not fully trained. Specify this ID when you want to ensure that you are opening a fully trained user |
SpeakerSave | Saves the speech files for the current user and displays a progess dialog. In Dragon NaturallySpeaking 4.1 and earlier, the user is asked whether or not they want to save their speech files |
TrainPhrases | Displays the Train Words dialog box |
Transcribe | Displays the Transcribe dialog box |
UserBackup | Displays the Backup User dialog box |
UserRestore | Displays the Restore User dialog box |
UserWizard Starts | The User Upgrade Wizard |
VocabularyBuilder (VocBuilder) | Displays the Import Words From List dialog box |
VocabularyEditor | Displays the Vocabulary Editor dialog box |