斯芬克斯语音识别延迟

时间:2011-07-08 22:02:16

标签: java cmusphinx

我正在使用开源的sphinx sdk进行语音识别。我目前正在运行HelloWorld示例。然而,响应非常缓慢,需要多次尝试才能识别一个单词,有时它会识别它,但需要一点点输出我所说的内容。任何想法如何改善这个?此外,当我更改语法文件时,它不会更新并识别我的新单词。

由于

1 个答案:

答案 0 :(得分:1)

  • 基本上,您可以在多种配置中使用Sphinx。如果您知道必须识别的语音模式,则可以使用custom grammar配置。
  • 在该配置中,它具有比正常配置更高的响应速率,因为它仅监听具有预定义模式的预定义字。 (一个语法)
  • 您可以按照JSGF标准定义自己的语法文件。 (more

示例配置

Configuration configuration = new Configuration();
configuration.setAcousticModelPath(ACOUSTIC_MODEL);
configuration.setDictionaryPath(DICTIONARY_PATH);
configuration.setGrammarPath(GRAMMAR_PATH);
configuration.setUseGrammar(true);
configuration.setGrammarName("mygrammar");

LiveSpeechRecognizer recognizer = new LiveSpeechRecognizer(configuration);

示例语法文件

#JSGF V1.0;
grammar mygrammar;
public <COMMON_COMMAND> = [please] turn (on | off) lighs;