How to control Microsoft Speech Recognition app?

笑着哭i 提交于 2019-12-11 04:13:33

问题


I want to know if it's possible to control "Microsoft Speech Recognition" using c#.


(source: yfrog.com)

Is it possible, for instance, to simulate the click on "On: Listen to everything I say" programmatically using c# or python?


回答1:


JRobert had the right idea.

If you were using C++, then you would call ISpRecognizer::SetRecoState(SPRST_ACTIVE), and then, if you're running on Windows 7, QI the ISpRecognizer for ISpRecognizer3 and call ISpRecognizer3::SetActiveCategory(NULL) to force the recognizer into the ON state.

But, since you're using C#, you should use System.Speech.Recognition.SpeechRecognizer and set the State property to Listening. (Note that this will not, as far as I know, switch from Sleep to On.)




回答2:


Here's Microsoft's Speech API documentation, and an example in Python.



来源:https://stackoverflow.com/questions/2972889/how-to-control-microsoft-speech-recognition-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!