Streaming input to System.Speech.Recognition.SpeechRecognitionEngine

前端 未结 5 1374
失恋的感觉
失恋的感觉 2020-11-30 06:03

I am trying to do \"streaming\" speech recognition in C# from a TCP socket. The problem I am having is that SpeechRecognitionEngine.SetInputToAudioStream() seems to require

5条回答
  •  失恋的感觉
    2020-11-30 06:51

    Have you tried wrapping the network stream in a System.IO.BufferedStream?

    NetworkStream netStream = new NetworkStream(socket,true);
    BufferedStream buffStream = new BufferedStream(netStream, 8000*16*1); // buffers 1 second worth of data
    appRecognizer.SetInputToAudioStream(buffStream, formatInfo);
    

提交回复
热议问题