最近研究了一下语音识别,用的是system.speech.dll
命名空间是
命名空间是
using System.Speech; using System.Speech.Recognition; using System.Speech.Synthesis;
但是识别出来的基本上不是本人说的话 有时候差距太远了 连“你好”都识别不出来
但有时候到时满准确的
大家有没有好的办法?本人觉得假如坑成这样的语音识别 微软也不好意思发布出来
另外看到有人添加grammar
本人也添加了但是 识别的精确性没有提高
本人想做到这点 本人说 语音识别 电脑可能识别成 余音时别 但是两者拼音差不多 本人应该有办法本人写代码让电脑搞定
但是本人命名说 语音识别 你听成一个 完全不相关的音 那就一点办法没有了
解决方案
60
语音识别技术(Auto Speech Recognize,简称ASR)所要解决的问题是让计算机能够“听懂”人类的语音,将语音中包含的文字信息“提取”出来。ASR技术在“能听会说”的智能计算机系统中扮演着重要角色,相当于给计算机系统安装上“耳朵”,使其具备“能听”的功能,进而实现信息时代利用“语音”这一最自然、最便捷的手段进行人机通信和交互。
public class SpRecognition
{
private static SpRecognition _Instance = null;
private SpeechLib.ISpeechRecoGrammar isrg;
private SpeechLib.SpSharedRecoContextClass ssrContex = null;
public delegate void StringEvent(string str);
public StringEvent SetMessage;
private SpRecognition()
{
ssrContex = new SpSharedRecoContextClass();
isrg = ssrContex.CreateGrammar(1);
SpeechLib._ISpeechRecoContextEvents_RecognitionEventHandler recHandle =
new _ISpeechRecoContextEvents_RecognitionEventHandler(ContexRecognition);
ssrContex.Recognition += recHandle;
}
public void BeginRec()
{
isrg.DictationSetState(SpeechRuleState.SGDSActive);
}
public static SpRecognition instance()
{
if (_Instance == null)
_Instance = new SpRecognition();
return _Instance;
}
public void CloseRec()
{
isrg.DictationSetState(SpeechRuleState.SGDSInactive);
}
private void ContexRecognition(int iIndex, object obj, SpeechLib.SpeechRecognitionType type, SpeechLib.ISpeechRecoResult result)
{
if (SetMessage != null)
{
SetMessage(result.PhraseInfo.GetText(0, -1, true));
}
}
}