Share via


SpeechRecognizer IsShared Property (SAPI 5.3)

Microsoft Speech API 5.3

Interface: ISpeechRecognizer

IsShared Property

The IsShared property indicates whether a recognition engine is shared or in process (InProc).

Syntax

Set: (This property is read-only)
Get: Boolean = SpeechRecognizer.IsShared

Parts

  • SpeechRecognizer
    The owning object.
  • Boolean
    Set: (This property is read-only)
    Get: A Boolean variable ISpeechRecognizer the property. True indicates the recognizer is shared; False indicates that it is an InProc recognizer.

Example

The following Visual Basic form code demonstrates the use of IsShared. Paste this code into the Declarations section of the form.

  
Option Explicit

Private Sub Form_Load()
    On Error GoTo EH

    Dim RC1 As SpSharedRecoContext
    Dim RC2 As SpInProcRecoContext
    Dim T As String

    Set RC1 = New SpSharedRecoContext
    Set RC2 = New SpInProcRecoContext

    If RC1.Recognizer.IsShared = True Then
        T = "Recognizer #1 is shared." & vbNewLine
    End If

    If RC2.Recognizer.IsShared = False Then
        T = T & "Recognizer #2 is Inproc."
    End If

    MsgBox T, vbInformation

EH:
    If Err.Number Then ShowErrMsg
End Sub

Private Sub ShowErrMsg()

    ' Declare identifiers:
    Dim T As String

    T = "Desc: " & Err.Description & vbNewLine
    T = T & "Err #: " & Err.Number
    MsgBox T, vbExclamation, "Run-Time Error"
    End

End Sub