InProc语音识别 [英] InProc speech recognition

查看:93
本文介绍了InProc语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,亲爱的我想在我的语音应用程序中使用InProc语音识别引擎,但没有发现任何有用的东西

这是来自Microsoft(sapi 5.1)
对于将在系统上单独运行且性能至关重要的大型服务器应用程序,InProc语音识别引擎更为合适.为了为InProc ISpRecognizer创建ISpRecoContext,应用程序必须首先在组件CLSID_SpInprocRecoInstance上调用CoCreateInstance,以创建自己的InProc ISpRecognizer.然后,应用程序必须调用ISpRecognizer :: SetInput(另请参阅ISpObjectToken)以设置音频输入.最后,应用程序可以调用ISpRecognizer :: CreateRecoContext以获得ISpRecoContext.

下一步是为应用程序感兴趣的事件设置通知.由于ISpRecognizer也是ISpEventSource,而ISpEventSource又是ISpNotifySource,因此应用程序可以从其ISpRecoContext调用ISpNotifySource方法之一,以指示该事件的位置应该报告ISpRecoContext.然后,它应该调用ISpEventSource :: SetInterest来指示需要通知哪些事件.最重要的事件是SPEI_RECOGNITION,它表示ISpRecognizer已识别出此ISpRecoContext的某些语音.有关其他可用语音识别事件的详细信息,请参见SPEVENTENUM.

最后,语音应用程序必须创建,加载和激活ISpRecoGrammar,该ISpRecoGrammar本质上指示要识别的语音类型,即听写或命令和控制语法.首先,应用程序使用ISpRecoContext :: CreateGrammar创建一个ISpRecoGrammar.然后,应用程序通过调用ISpRecoGrammar :: LoadDictation进行听写或通过ISpRecoGrammar :: LoadCmdxxx方法之一进行命令和控制来加载适当的语法.最后,为了激活这些语法以便可以开始识别,应用程序调用ISpRecoGrammar :: SetDictationState进行听写,或者调用ISpRecoGrammar :: SetRuleState或ISpRecoGrammar :: SetRuleIdState进行命令和控制.
当通过请求的通知机制将识别返回给应用程序时,SPEVENT结构的lParam成员将是ISpRecoResult,通过该ISpRecoResult应用程序可以确定识别了哪些内容以及ISpRecoContext的哪个ISpRecoGrammar.

一个ISpRecognizer,无论是共享的还是InProc的,都可以具有多个与之关联的ISpRecoContext,并且可以用与之相关的事件的方式来通知每个ISpRecognizer.一个ISpRecoContext可以从中创建多个ISpRecoGrammars,每个ISpRecoGrammars用于识别不同类型的发声.

Hi Dears I want to use InProc speech recognition engine in my speech application but I didn''t found any thing usefull

here is from microsoft (sapi 5.1)
For large server applications that would run alone on a system, and for which performance is key, an InProc speech recognition engine is more appropriate. In order to create an ISpRecoContext for an InProc ISpRecognizer, the application must first call CoCreateInstance on the component CLSID_SpInprocRecoInstance to create its own InProc ISpRecognizer. Then the application must make a call to ISpRecognizer::SetInput (see also ISpObjectToken) in order to set up the audio input. Finally, the application can call ISpRecognizer::CreateRecoContext to obtain an ISpRecoContext.

The next step is to set up notifications for events the application is interested in. As the ISpRecognizer is also an ISpEventSource, which in turn is an ISpNotifySource, the application can call one of the ISpNotifySource methods from its ISpRecoContext to indicate where the events for that ISpRecoContext should be reported. Then it should call ISpEventSource::SetInterest to indicate which events it needs to be notified of. The most important event is the SPEI_RECOGNITION, which indicates that the ISpRecognizer has recognized some speech for this ISpRecoContext. See SPEVENTENUM for details on the other available speech recognition events.

Finally, a speech application must create, load, and activate an ISpRecoGrammar, which essentially indicates what type of utterances to recognize, i.e., dictation or a command and control grammar. First, the application creates an ISpRecoGrammar using ISpRecoContext::CreateGrammar. Then, the application loads the appropriate grammar, either by calling ISpRecoGrammar::LoadDictation for dictation or one of the ISpRecoGrammar::LoadCmdxxx methods for command and control. Finally, in order to activate these grammars so that recognition can start, the application calls ISpRecoGrammar::SetDictationState for dictation or ISpRecoGrammar::SetRuleState or ISpRecoGrammar::SetRuleIdState for command and control.

When recognitions come back to the application by means of the requested notification mechanism, the lParam member of the SPEVENT structure will be an ISpRecoResult by which the application can determine what was recognized and for which ISpRecoGrammar of the ISpRecoContext.

An ISpRecognizer, whether shared or InProc, can have multiple ISpRecoContexts associated with it, and each one can be notified in its own way of events pertaining to it. An ISpRecoContext can have multiple ISpRecoGrammars created from it, each one for recognizing different types of utterances.

推荐答案

什么?确切地说,您的问题是什么?
And what - precisely - is your question?


如何为InProc语音识别引擎将音频输入"设置为默认麦克风?
谢谢!
How to set Audio Input to default microphone for InProc speech recognition engine ?
thanks!


谢谢我的朋友,但是我是一些简单的说明,可以使用sapi5.1(在vb中)
我是C#程序员,我进行了很多搜索,但没有发现任何有用的东西!
谢谢
Thanks my friend but I was some simple instructions to work with sapi5.1(in vb)
I''m a C# programmer and I have searched a lot but I didn''t found any thing useful!
thanks


这篇关于InProc语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆