我使用以下代码设置识别器(应该让您了解初始化操作的顺序和使用的模型):
File modelsDir = new File(assetsDir, "models");
recognizer = defaultSetup()
.setAcousticModel(new File(modelsDir, "hmm/lium_french_f2"))
.setDictionary(new File(modelsDir, "dict/frenchWords62K.dic"))
.setRawLogDir(assetsDir).setKeywordThreshold(1e-20f)
.getRecognizer();
recognizer.addListener(this);
// Create keyword-activation search.
recognizer.addKeyphraseSearch(KWS_SEARCH, WAKEPHRASE);
我收到以下错误 - 有什么想法吗?相同的代码与英语模型完美配合。
java.lang.RuntimeException: Decoder_setSearch returned -1
at edu.cmu.pocketsphinx.PocketSphinxJNI.Decoder_setSearch(Native Method)
at edu.cmu.pocketsphinx.Decoder.setSearch(Unknown Source)
at edu.cmu.pocketsphinx.SpeechRecognizer.startListening(Unknown Source)