Partager via


SpeechRecoContext AudioInputInterferenceStatus Property (SAPI 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.

Syntax

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

Parts

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

Example

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

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