关于训练sapi [英] about training sapi

查看:71
本文介绍了关于训练sapi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的!
经过数周的搜索,我发现这与培训sapi(所有版本)有关,但问题是我无法在C#中使用ISpTranscript.
请帮忙!
这真的很紧急(请考虑我们必须通过COM互操作使用sapi,但由于方法使我感到困惑,所以我没有找到如何连接到非托管sapi ISpTranscript的方法.

< pre>
创建一个过程识别器&绑定适当的音频输入.

确保保留音频以供识别;您以后需要它.

创建一个包含要训练的文本的语法.

设置语法状态以在识别发生时暂停识别器. (这也有助于从音频文件进行训练.)

发生识别时:

获取识别的文本和保留的音频.

使用CoCreateInstance(CLSID_SpStream)创建一个流对象.

使用ISpRecognizer :: GetObjectToken和ISpObjectToken :: GetStorageFileName创建培训音频文件,并将其绑定到流(使用ISpStream :: BindToFile).
将保留的音频复制到流对象中.

QI IspTranscript接口的流对象,并使用ISpTranscript :: AppendTranscript将识别的文本添加到流中.
</pre>


真的非常感谢

Hi Dears!
After lot''s of weeks searching I found this about training sapi (all versions) but the problem is that I can''t use ISpTranscript in C#
please help !
It''s really an emergency (please consider that we must work with sapi through COM interop but I didn''t find out how to connect to unmanaged sapi ISpTranscript beacuse it''s methods had mixed me up!

<pre>
Create an inproc recognizer & bind the appropriate audio input.

Ensure that you’re retaining the audio for your recognitions; you’ll need it later.

Create a grammar containing the text to train.

Set the grammar’s state to pause the recognizer when a recognition occurs. (This helps with training from an audio file, as well.)

When a recognition occurs:

Get the recognized text and the retained audio.

Create a stream object using CoCreateInstance(CLSID_SpStream).

Create a training audio file using ISpRecognizer::GetObjectToken, and ISpObjectToken::GetStorageFileName , and bind it to the stream (using ISpStream::BindToFile).

Copy the retained audio into the stream object.

QI the stream object for the ISpTranscript interface, and use ISpTranscript::AppendTranscript to add the recognized text to the stream.
</pre>


really thanks

推荐答案

faslesabz写道:
faslesabz wrote:

这真的很紧急



您可能会惊讶地发现,这里没有人与您分享您的观点.这看起来很像一个家庭作业或考试题,不是该网站的目的.遇到实际问题和有待回答的问题时,请尝试编写一些代码并卷土重来.



You may be surprised to learn that nobody here shares your opinion on that. This looks very like a homework or exam question which is not something that this site is for. Try writing some code and comeback when you have a real issue and an answerable question.


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

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