【问题标题】:SpeechRecognitionEngine is always recognizing a word of the choice even if its wrongSpeechRecognitionEngine 始终识别选择的单词,即使它是错误的
【发布时间】:2012-12-21 19:26:54
【问题描述】:

我正在使用 SpeechRecognitionEngine 库在 C# 中进行语音识别,我已将单词“start”设置为要识别的单词(选择):

Choices choices_start = new Choices("start");
GrammarBuilder grBuilder_start = new GrammarBuilder(choices_start);
Grammar grammar_start = new Grammar(grBuilder_start);

SpeechRecognitionEngine speech = new SpeechRecognitionEngine();
speech.LoadGrammar(grammar_start);
speech.SpeechRecognized += RecognizerSpeechRecognized;

private void RecognizerSpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
    foreach (RecognizedWordUnit word in e.Result.Words)
    {
        switch (word.Text)
        {
            case "start":
                Console.WriteLine(word.Text);
                speech.UnloadGrammar(grammar_start);
                speech.LoadGrammar(grammar_using);
                break;
            default:
                Console.WriteLine(word.Text);
                break;
        }
    }
}

问题是不管我说什么,它总是能识别“开始”这个词,知道为什么吗?

【问题讨论】:

    标签: c# speech-recognition speech


    【解决方案1】:

    这就是算法的工作原理。只要您只给它一个选择,它只会返回给定的单词。你需要给它更多的文本变体来寻找。

    例如,如果您想识别任意文本,您可以使用DictationGrammar 而不是简单的语法。请注意,单词列表仍然有限,无法识别非常稀有的单词。但是列表会很大。

    如果您的任务是在连续流中查找特定单词,则需要查找关键字识别引擎,而不是语音识别引擎。 Microsoft 不提供关键字发现引擎功能。你可以使用像CMUSphinx这样的开源引擎来构建一个

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-29
      • 2012-03-08
      相关资源
      最近更新 更多