Use TAPI Wave/in/out device for input to Microsoft Speech Recognition? Do I need a stream?

38 views
Skip to first unread message

fnde...@gmail.com

unread,
Apr 14, 2017, 12:08:34 PM4/14/17
to
The SDK for Windows Server speech v11 has a .SetInputToDefaultAudioDevice, but obviously a telephony app needs to listen to any of the audio devices associated with TAPI line devices to do speech recognition. There is a .SetInputToAudioStream and .SetInputToMemoryStream. I tried many ways and could not get it to work. Here is something that got me close, but it gives me a COM error trying to set an spMMAudioIn to a system.io.stream object.

Dim sre As New SpeechRecognitionEngine
Dim fmt As New SpeechAudioFormatInfo(8000, AudioBitsPerSample.Sixteen, AudioChannel.Mono)
Dim audiosource As ISpeechMMSysAudio
audiosource = New SpMMAudioIn
audiosource.DeviceId = etLine1.WaveRecordID 'set audio input to audio device Id
sre.SetInputToAudioStream(audiosource, fmt)

I thought of trying to use Directsound to get the device ID. Can anyone help.
Reply all
Reply to author
Forward
0 new messages