问题描述
我想在我的应用程序打开的窗户SAPI火车车窗
I want to open windows sapi train window in my application.
我觉得这个过程中的文件路径为C:\Windows\System32\Speech\\ \\SpeechUX\SpeechUXWiz.exe。但是当我试图通过dobule点击打开它,它faild.I尝试通过的Process.Start()方法也将被faild在我的应用程序中打开此文件。
I find this process's file path is "C:\Windows\System32\Speech\SpeechUX\SpeechUXWiz.exe".But when i attempt to open it by dobule click,it faild.I try to open this file in my application by process.start() method will be faild too.
Process.Start(@"C:\Windows\System32\Speech\SpeechUX\SpeechUXWiz.exe");
有没有人知道如何打开呢?是否有一个接口来做到这一点在SAPI?谢谢!
Is there someone know how to open it? Is there a interface to do that in sapi? Thank you!
我的系统是64位的windows7。
My system is windows7 x64.
推荐答案
不要直接启动这一进程;在命令行的细节是依赖于版本的(并且,实际上,这个过程本身可能因版本变化)。
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).
您可以开始培训(C#)使用speechlib(SAPI的IDispatch接口兼容API)。看看。
You can start training (in C#) using speechlib (the SAPI IDispatch-compatible API). Look at ISpeechRecognizer::DisplayUI.
要使用SpeechLib,添加
To use SpeechLib, add
using SpeechLib;
你的代码,并添加引用(通过项目/添加引用/ COM)的<$ 。C $ C>微软语音对象库到项目
然后,开始训练,你就会有一些代码,如下所示:
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, "");
}
这篇关于如何在C#应用程序打开的SAPI车窗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!