在Windows语音识别中使用SrgsItem和SrgsToken构建语法(vb .net) [英] Use of SrgsItem and SrgsToken in Windows Speech recognition to build Grammar (vb .net)

查看:79
本文介绍了在Windows语音识别中使用SrgsItem和SrgsToken构建语法(vb .net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用以下代码的语音识别程序如果我这样做"退出Do"直接在Loop上方,它可以很好地识别第一个单词。如果我让它循环,那么SItem,Srule和SDoc ALL恰当地说包含50个项目。语法WILL
加载SDoc,但识别引擎会识别出所说的NOTHING。但是,如果我只向SItem添加一个令牌,它将每次都识别出来。 (是的Stream文件格式正确,我检查的第一件事)我错过了什么?我有
甚至尝试了Dim SItem()SrgsItem并向SRule添加了一个集合,甚至没有添加所有项目。 Dim SItem As New SrgsItem Dim sToken As SrgsToken Do until sr.EndOfStream = True mps = sr.ReadLine amps = mps.Split(" |")sToken = New SrgsToken(amps(0))
sToken.Pronunciation = amps(1)SItem.Add(sToken)Loop Dim SRule As New SrgsRule(" main",SItem)Dim SDoc As New SrgsDocument(sruls)srgsdoc.PhoneticAlphabet = SrgsPhoneticAlphabet.Ups Dim mygram As New Grammar(srgsdoc)

解决方案


Hi Anbu ,



欢迎来到MSDN论坛。



我建议您尝试以下类别以获得更有效的响应。



               
< a href ="http://gotspeech.net/forums/34/ShowForum.aspx"rel ="nofollow"> GotSpeech.NET - SAPI和System.Speech开发



感谢您的理解和支持。





I have a speech recognition program using the following code If I do "exit Do" directly above Loop it works perfectly to recognize the first word. If I let it loop, the SItem,Srule,and SDoc ALL properly say there are 50 items contained. The grammar WILL load the SDoc, but the recognition engine will recognize NOTHING that is said. However if I add one Token Only to SItem it will recognize that every single time. (Yes the Stream file is formated correctly, first thing I checked) Am I missing something? I've even tried Dim SItem() SrgsItem and adding a collection to the SRule, that didn't even add all the items to it. Dim SItem As New SrgsItem Dim sToken As SrgsToken Do Until sr.EndOfStream = True mps = sr.ReadLine amps = mps.Split("|") sToken = New SrgsToken(amps(0)) sToken.Pronunciation = amps(1) SItem.Add(sToken) Loop Dim SRule As New SrgsRule("main", SItem) Dim SDoc As New SrgsDocument(sruls) srgsdoc.PhoneticAlphabet = SrgsPhoneticAlphabet.Ups Dim mygram As New Grammar(srgsdoc)


When you lose your mind, you free you life.

解决方案

Hi Anbu,

Welcome to the MSDN Forum.

I would suggest you to try the following category for more efficient responses.

                GotSpeech.NET - SAPI and System.Speech Development

Thanks for your understanding and support.


这篇关于在Windows语音识别中使用SrgsItem和SrgsToken构建语法(vb .net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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