Bagikan melalui


Note

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

SpeechRecognitionEngine.SetInputToWaveStream Method

Configures the SpeechRecognitionEngine object to receive input from a stream that contains Waveform audio format (.wav) data.

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

Syntax

'Declaration
Public Sub SetInputToWaveStream ( _
    audioSource As Stream _
)
'Usage
Dim instance As SpeechRecognitionEngine
Dim audioSource As Stream

instance.SetInputToWaveStream(audioSource)
public void SetInputToWaveStream(
    Stream audioSource
)

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.

The audio file can be in WMA format provided that both of the following conditions are met.

  • The WMA codec is available.

  • The target operating system has the appropriate Windows features installed or enabled.

    • A computer running Microsoft Windows Server 2003 x64 Editions must have Windows Media Format 9.5 Software Development Kit (SDK) x64 Edition installed.

    • A computer running Microsoft Windows Server 2008 or Windows Server 2008 R2 must have the Desktop Experience feature installed, as described in the following procedure.

    • Windows Vista and Windows 7 already have the Desktop Experience feature enabled automatically.

To install the Desktop Experience feature (Windows Server 2008, Windows Server 2008 R2)

  1. On the Start menu, click Server Management.

  2. In the Server Management dialog box, in the Features Summary pane, click Add Features.

  3. In the Select Features dialog box, select the Desktop Experience check box, and then click Install.

See Also

Reference

SpeechRecognitionEngine Class

SpeechRecognitionEngine Members

Microsoft.Speech.Recognition Namespace

SetInputToAudioStream

SetInputToDefaultAudioDevice

SetInputToNull

SetInputToWaveFile

RecognizeCompleted