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 DialogDescription
RecoProfilePropertiesView the speaker profile properties
UserTrainingTrain the speaker profile
MicTrainingAdjust microphone settings
Dragon NaturallySpeaking Dialog
AboutDisplays the Dragon NaturallySpeaking About dialog box
AccuracyAssistantDisplays 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
AccuracyCenterDisplays the Accuracy Center that provides a central location for taking advantage of all the available tools for improving recognition accuracy
AddWordDisplays the Add Word dialog box
AddWordFromListDisplays the Import Words from list dialog box that enables users to add words from lists to their vocabulary
AddWordsFromDocsDisplays the Add Words from Documents dialog box
AudioSetupWizard (MicTraining)Runs the Audio Setup wizard to perform additional tuning of the audio settings
CommandBrowserDisplays the Command Browser used to view and train commands, create and modify commands, import and export commands, and change the availability of custom commands
DictationShortcutsDisplays the MyCommands Editor to create and edit voice commands
EditCommandWizardDisplays the MyCommands Editor to create and edit voice commands
EnginePropertiesDisplays the Dragon NaturallySpeaking Options dialog box
FormattingOptionsDisplays 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
HelpTopicsDisplays the Dragon NaturallySpeaking Help viewer
ImportDVCDisplays the Import Command Files dialog box
ManageUsersDisplays the Manage Users dialog box to create, edit, and delete users
MobileTrainingRuns supplemental Mobile Training
NewCommandWizardRuns the MyCommands Editor to create voice commands
NewVocabularyDisplays the New Vocabulary dialog box
OpenVocabularyDisplays the Manage Vocabularies dialog box
PerformanceAssistantDisplays the Performance Assistant Help file
RecognitionHistoryDisplays the Recognition History dialog box
RemoveDVCDisplays the Delete Command Files dialog box
RoamingUsersOptionsDisplays the Administrative Settings dialog box that contains Roaming User options
SpeakerNewStarts the New User wizard. Specify this ID when you want to create a user and run first-time audio setup and General Training
SpeakerOpenDisplays 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
SpeakerSaveSaves 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
TrainPhrasesDisplays the Train Words dialog box
TranscribeDisplays the Transcribe dialog box
UserBackupDisplays the Backup User dialog box
UserRestoreDisplays the Restore User dialog box
UserWizard StartsThe User Upgrade Wizard
VocabularyBuilder (VocBuilder)Displays the Import Words From List dialog box
VocabularyEditorDisplays the Vocabulary Editor dialog box