SpeechRecoContext AudioInputInterferenceStatus Property (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

Interface: ISpeechRecoContext

AudioInputInterferenceStatus Property

The AudioInputInterferenceStatus property returns information about interference with the audio input of the recognition context.

This information is usually returned by the ISpeechRecoContext Interference event.


Set: (This property is read-only)
Get: SpeechInterference = SpeechRecoContext.AudioInputInterferenceStatus


The owning object.
Set: (This property is read-only)
Get: A SpeechInterference constant reflecting the interference type.


The following Visual Basic form code demonstrates retrieving the interference status for the last recognition. To run this code, paste it into the Declarations section of a form.

Option Explicit

Public WithEvents RecognitionContext As SpSharedRecoContext

Private Sub Form_Load()
    On Error GoTo EH

    Const NL = vbNewLine
    Dim Interference As SpeechInterference
    Dim T As String

    ' Speech processing code would go here.

    Set RecognitionContext = New SpSharedRecoContext
    Interference = RecognitionContext.AudioInputInterferenceStatus

    If Interference = 0 Then
        T = "No interference. The AudioInputInterferenceStatus" & NL
        T = T & "property must return a value greater than 0 in order" & NL
        T = T & "to raise the Interference event of a recognition object."
        MsgBox T, vbInformation
    End If

    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 Sub
© 2015 Microsoft