You are reading help file online using chmlib.com
|
Interface: ISpeechRecognizer
The DisplayUI method initiates the display of the specified UI.
The speech recognition (SR) and text-to-speech (TTS) engines are capable of displaying and running various user interfaces (UI). These displays assist with different aspects of the speech environment:
Many of these UIs are available using Speech properties in Control Panel. In addition, engines are capable of requesting specific UIs be run to improve a situation. For example, the SR could request more user training if the recognitions are consistently poor.
Engines are not required to support UIs and not all engines will have the same UIs. Consult the manufacturer's engine documentation for specific details. An application may call ISpeechRecognizer.IsUISupported before attempting to invoke a particular UI to see if the engine supports it. Invoking unsupported UIs will cause a run-time error. If the UI is available, use ISpeechRecognizer.DisplayUI to invoke the display.
SpeechRecognizer.DisplayUI(
hWndParent As Long,
Title As String,
TypeOfUI As String,
[ExtraData As Variant = Nothing]
)
None.
See ISpeechRecognizer.IsUISupported and ISpeechRecoContext.RequestUI for additional information.
The following Visual Basic form code demonstrates the use of the DisplayUI event. The application runs the training wizard, the same one available using Speech properties in Control Panel.
To run this code, create a form with the following control:
Paste this code into the Declarations section of the form.
Public WithEvents RC As SpSharedRecoContext
Public myGrammar As ISpeechRecoGrammar
Private Sub Command1_Click()
Dim theRecognitizer As ISpeechRecognizer
Set theRecognizer = RC.Recognizer
theRecognizer.DisplayUI Form1.hWnd, "My App's Additional Training", SpeechUserTraining, vbNullString
End Sub
Private Sub Form_Load()
Set RC = New SpSharedRecoContext
Set myGrammar = RC.CreateGrammar
myGrammar.DictationSetState SGDSActive
End Sub
You are reading help file online using chmlib.com
|