Microsoft.Speech SpeechRecognitionEngine.setInputT

2019-02-15 07:31发布

I'm using Microsoft.Speech (NOT System.Speech!) and I'm trying to set the input of the audio stream to my microphone, which is the default audio device, but it is throwing the exception:

System.InvalidOperationException' occurred in Microsoft.Speech.dll but was not handled in user code`

Additional information: Cannot find the requested data item, such as a data key or value.

This was just a test, ideally I want to set the audio stream to my speakers, but if I can get this to work I can just use a virtual audio device software to plug into the mic stream. If anyone can also set the audio stream to the speakers directly, that would be perfect.

Your help is appreciated!

1条回答
再贱就再见
2楼-- · 2019-02-15 08:21

Based on limited information on the net, the situation is the following. Microsoft.Speech recognizer is recognizer for servers, like VXML servers and it might not support all audio devices and all input rates. For example, it might be that your audio driver does not support recording with low quality. So Microsoft.Speech might not accept your audio device.

You need to use System.Speech API instead, it is designed for desktop API and should work.

查看更多
登录 后发表回答