0

我正在使用以下代码来设置识别器(应该让您了解使用的初始化操作和模型的顺序):

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)
4

0 回答 0