Kaa*_*aan 6 c# speech-recognition speech-to-text
我使用System.Speech库来识别语音,但它通常识别出非常不同.
SpeechRecognizer_rec = new SpeechRecognizer();
DictationGrammar grammar = new DictationGrammar();
grammar.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(grammar_SpeechRecognized);
_rec.LoadGrammar(grammar);
Run Code Online (Sandbox Code Playgroud)
如何改善复原?它与Grammer类有关系吗?
您必须限制语音识别引擎使用的模型(基本上是从语音输入到允许的英语文本输出的映射)以获得高置信度输出.模型越小,结果总体上越好,因为识别器拾取的可能性较小,即两个相似的发声单词之间的错误单词.
这个简化的例子即只能识别一到三个数字:
SpeechRecognizer rec = new SpeechRecognizer();
Choices c = new Choices();
c.Add("one");
c.Add("two");
c.Add("three");
var gb = new GrammarBuilder(c);
var g = new Grammar(gb);
rec.LoadGrammar(g);
Run Code Online (Sandbox Code Playgroud)
如果你有能力让用户去参加培训过程,这肯定会给你带来更好的结果.我已经习惯了(我有一个口音),它在我的应用程序中显着提高了识别的准确性.至少你可以自己尝试(控制面板,语音识别,训练你的电脑以更好地了解你).实际上,培训或减少模型(当然,在安静的地方使用更好的麦克风使用您的应用程序)是提高结果准确性的唯一方法.