Partilhar via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

SpeechRecognitionEngine.SetInputToAudioStream Method

Configures the SpeechRecognitionEngine object to receive input from an audio stream.

Namespace:  Microsoft.Speech.Recognition
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

Syntax

'Declaration
Public Sub SetInputToAudioStream ( _
    audioSource As Stream, _
    audioFormat As SpeechAudioFormatInfo _
)
'Usage
Dim instance As SpeechRecognitionEngine
Dim audioSource As Stream
Dim audioFormat As SpeechAudioFormatInfo

instance.SetInputToAudioStream(audioSource, _
    audioFormat)
public void SetInputToAudioStream(
    Stream audioSource,
    SpeechAudioFormatInfo audioFormat
)

Parameters

Remarks

If the recognizer reaches the end of the input stream during a recognition operation, the recognition operation finalizes with the available input. Any subsequent recognition operations can generate an exception, unless you update the input to the recognizer.

See Also

Reference

SpeechRecognitionEngine Class

SpeechRecognitionEngine Members

Microsoft.Speech.Recognition Namespace

SetInputToDefaultAudioDevice

SetInputToNull

SetInputToWaveFile

SetInputToWaveStream

RecognizeCompleted