How to open sapi train window in a c# application?

徘徊边缘 提交于 2019-11-28 01:40:55

Don't start the process directly; the details of the command line are version-dependent (and, in fact, the process itself may change from version to version).

You can start training (in C#) using speechlib (the SAPI IDispatch-compatible API). Look at ISpeechRecognizer::DisplayUI.

To use SpeechLib, add

using SpeechLib;

to your code, and add a reference (via Project/Add Reference/COM) to the Microsoft Speech Object Library to your project.

Then, to start training, you would have some code that looks like this:

static void RunTraining()
{
    SpSharedRecoContext RC = new SpSharedRecoContext();
    string Title = "My App's Training";
    ISpeechRecognizer spRecog = RC.Recognizer;
    spRecog.DisplayUI(hWnd, Title, SpeechLib.SpeechStringConstants.SpeechUserTraining, "");
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!