SpeechRecognizer IsShared Property

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

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. The application displays whether the recognizer is shared or InProc.

To run this code, create a form with the following control:

  • A label called Label1
  • Paste this code into the Declarations section of the form.

    The Form_Load procedure creates and activates a dictation grammar.

    Public WithEvents RC As SpSharedRecoContext
    Public myGrammar As ISpeechRecoGrammar
    
    Private Sub Form_Load()
        Set RC = New SpSharedRecoContext
        
        Set myGrammar = RC.CreateGrammar
        myGrammar.DictationSetState SGDSActive
        
        Dim procShared As Boolean
        procShared = RC.Recognizer.isShared
        If procShared = True Then
            Label1.Caption = "Recognizer is shared."
        Else
            Label1.Caption = "Recognizer is inproc."
        End If
    End Sub