SPDUI_UserTraining

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

SPDUI_UserTraining (C/C++)

SpeechUserTraining (Automation)


SPDUI_UserTraining defines the string for displaying a speech recognition (SR) engine's User Training UI.

It is not a SAPI 5 compliance requirement for an SR engine to implement this UI for SPDUI_UserTraining.

When to Implement

When writing a speech engine for the desktop or a graphical environment, users can train the engine either before the first use, or when recognition accuracy is poor.

Use the SR tab of Speech properties in Control Panel to change settings for all installed SAPI 5-compliant SR engines. Click Train Profile to change settings on a per-user/per-engine basis. Use Train Profile to directly accesses each engine's Settings UI using SPDUI_UserTraining. If the SR engine does not support the training UI (see ISpTokenUI::IsUISupported), Train Profile will be unavailable.

When to Access

The application could monitor the user's speech experience by recognition accuracy. If a user encounters too many false recognitions or recognition corrections, the application could recommend that the user perform more recognizer training.

Also, an SR engine can send a SPEI_REQUEST_UI event to the application if it determines that the user needs to perform additional recognizer training. (see also ISpRecognizer::IsUISupported and ISpRecognizer::DisplayUI)


#define SPDUI_UserTraining        L"UserTraining"

Example

The following code snippet illustrates the use of ISpTokenUI::IsUISupported using SPDUI_UserTraining.

    HRESULT hr = S_OK;

    // get the default speech recognizer token
    hr = SpGetDefaultTokenFromCategoryId(SPCAT_RECOGNIZERS, &cpObjectToken);
    // Check hr

    // get the object token's UI
    hr = cpObjectToken->QueryInterface(&cpTokenUI);
    // Check hr

    // check if the default speech recognizer has UI for performing User Training 
    hr = cpTokenUI->IsUISupported(SPDUI_UserTraining, NULL, NULL, NULL, &fSupported);
    // Check hr

    // if fSupported == TRUE, then default speech recognizer has UI for User Training 

The following code snippet illustrates the use of ISpRecognizer::DisplayUI using SPDUI_UserTraining.

    HRESULT hr = S_OK;

    // display user training UI for the current recognizer
    hr = cpRecognizer->DisplayUI(MY_HWND, MY_APP_USER_TRAINING, SPDUI_UserTraining, NULL, NULL);
    // Check hr