Share via


SPDUI_UserTraining

This variable defines the string for displaying an SR Engine's User Training UI.

It is not a SAPI 5 compliance requirement for a speech recognition engine to implement UI for SPDUI_UserTraining.

When to Implement

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

The Speech Control Panel allows the user to change settings for all installed SAPI 5-compliant SR Engines. Choose 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), the Train Profile button 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 ask the user if they would like to 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

See Also

SAPI Global Variables

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.