How to control Microsoft Speech Recognition app?

2019-07-28 21:35发布

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

alt text http://a.yfrog.com/img191/8859/enable.png

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

2条回答
Root(大扎)
2楼-- · 2019-07-28 21:42

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.)

查看更多
We Are One
3楼-- · 2019-07-28 21:48

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

查看更多
登录 后发表回答