我正在使用开源 sphinx sdk 进行一些语音识别。我目前正在运行 HelloWorld 示例。但是反应非常迟钝,需要多次尝试才能识别一个单词,有时它会识别它但需要一点时间才能输出我所说的内容。任何想法如何改善这一点?此外,当我更改语法文件时,它不会更新并识别我的新单词。
谢谢
Sphinx
在多种配置中使用。如果您知道必须识别的语音模式,则可以使用配置custom grammar
。示例配置
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;