我已经阅读了cmusphinx教程,并成功地运行了袖珍狮身人面像机器人演示。
现在我想修改演示并添加对意大利语的支持。
在意大利语模型下载页面(这里)中,我可以看到两个文件:
我在/src/main/assets/sync
下复制了字典,并创建了一个包含/src/main/assets/sync
内容的新文件夹/src/main/assets/sync/it-ptm
来设置模型。然后,我通过添加以下意大利资源列表修改了assets.lst
文件:
cmudict-en-us.dict
digits.gram
en-phone.dmp
en-us-ptm/README
en-us-ptm/feat.params
en-us-ptm/mdef
en-us-ptm/means
en-us-ptm/noisedict
en-us-ptm/sendump
en-us-ptm/transition_matrices
en-us-ptm/variances
it-ptm/feat.params
it-ptm/feature_transform
it-ptm/mdef
it-ptm/means
it-ptm/mixture_weights
it-ptm/noisedict
it-ptm/transition_matrices
it-ptm/variances
it.dic
menu.gram
weather.dmp
最后,我对代码进行了如下修改:
recognizer = defaultSetup()
.setAcousticModel(new File(assetsDir, "it-ptm"))
.setDictionary(new File(assetsDir, "it.dic"))
项目构建成功,但应用程序在资产同步之后崩溃。这里记录的错误是:
I/cmusphinx: INFO: ocketsphinx.c(145):从/storage/emulated/0/Android/data/edu.cmu.sphinx.pocketsphinx/files/sync/it-ptm/feat.params解析特定于模型的特性参数
E/cmusphinx:致命:"cmn.c",第126行:未知CMN类型的‘批处理’
有人能告诉我怎么回事吗?谢谢
发布于 2017-01-05 22:00:49
你的pocketsphinx文件太旧了,你需要更新它们,它应该能工作。您可以从github签出最新版本。
https://stackoverflow.com/questions/41475906
复制相似问题