SpeechRecognitionEngine.SetInputToAudioStream streaming realtime audio RRS feed

  • Question

  • In .NET 3.5, System.Speech.Recognition SpeechRecognitionEngine.SetInputToAudioStream Method doesn't seem to support real-time input.
    I read a comment in MSDN "You may be led to believe that this allows you to stream audio to the engine in real-time, given that the other, similar methods look like they're used for pre-recorded streams, but this actually only supports a pre-recorded stream as well. The internal wrapper for the stream does not implement the ISpAudio interface required by SAPI to do real-time streaming, so this method cannot do real-time streaming."
    I am developing a windows application and I want to provide real-time input stream from the network. How could I accomplish this? Could someone help me with a work-around?
    Thank you. 
    Monday, October 11, 2010 11:16 AM

All replies

  • Hi John,

    You can use the waveOutOpen API (using PInvoke) to play "raw" sample data from streamed input. This family of API calls lets you open a playback device and then queue up sample buffers (of arbitrary length each) for playback.

    You do not need to save the received audio chunks to disk before playing them - in fact, you don't wantto do this unless you actually want a recording of the audio as well.

    waveOutOpen links:



    Regards, http://www.shwetalodha.blogspot.in/

    Sunday, August 26, 2012 9:51 AM
  • I have this same issue. I have a control that already does WaveInOpen(). If this is supposed to support telephony, then why isn't there a .SetInputToAudioDeviceID? A telephony app NEVER uses a default audio device. How do you point to one of the many other audio devices on the PC? Why can't I do this:

    Public m_AudioIn As ISpeechMMSysAudio
    Private Sub Form_Load()
    m_AudioIn = New Speechlib.spMMAudioIn
    m_AudioIn.DeviceID = TapiHelper.WaveInDeviceID
    Recognizer1.AudioInputStream = m_AudioIn 'MMSysAudioIn
    End Sub

    Thursday, June 22, 2017 5:20 PM