You are reading help file online using chmlib.com
|
ISpRecognizer::DisplayUI displays the requested UI component from the underlying SR engine.
[local] HRESULT DisplayUI(
HWND hwndParent,
const WCHAR *pszTitle,
const WCHAR *pszTypeOfUI,
void *pvExtraData,
ULONG cbExtraData
);
Value | Description |
---|---|
S_OK | Function completed successfully. |
S_FALSE | The UI is supported but not with the current run-time environment or parameters. |
FAILED(hr) | Appropriate error message. |
SAPI 5 speech recognition engines are capable of sending UI requests back to the application using SPEI_REQUEST_UI. For example, if the SR engine is receiving a poor audio input signal, it may request the user to perform Microphone Training (see SPDUI_MicTraining). The application can receive these requests by calling ISpRecognizer::SetInterest with SPEI_REQUEST_UI. When the UI request is received, it can call ISpRecognizer::DisplayUI at an appropriate point. The typical SR engine UI requests could be User Training (see SPDUI_UserTraining), Microphone Training (see SPDUI_MicTraining), and Lexicon Updates (see SPDUI_AddRemoveWord). An application can call DisplayUI at any time, and does not necessarily have to wait for a UI request from the SR engine.
To best apply ISpRecognizer::DisplayUI, call ISpRecognizer::IsUISupported with a specific UI type before calling DisplayUI. (see the SR Engine Guide for further information on how an SR engine should implement UI.
The call to DisplayUI is synchronous, so the call will not return until the UI has been closed.
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
You are reading help file online using chmlib.com
|