且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SpeechRecognitionEngine.SetInputToAudioStream流实时音频

更新时间:2023-11-18 17:18:16

John,您好,

Hi John,

您可以使用 waveOutOpen   API (使用PInvoke)播放原始"歌曲,从流输入中采样数据.使用该API调用系列,您可以打开播放设备,然后将样本缓冲区(每个缓冲区的长度)排队等待播放.

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.