我想使用pocketsphinx-android-demo-5prealpha创建语音识别应用程序。我只需要这个应用程序就可以使用西班牙语。
我用西班牙的voxforge包(voxforge-es-0.2.tar.gz)替换了默认的声学和语言模型。
在英语中,默认情况下,该应用程序在我的手机中正常工作:三星Galaxy S4(i9505)与Android KitKat 442.
当我替换语言和声学语料库并重新编译项目时,应用程序崩溃,我通过logcat获取下一个错误。我将“KEYPHRASE”更改为“comenzar”(意思是“开始”或“启动”)来测试应用程序。
这是错误:
02-19 17:28:57.188: I/SpeechRecognizer(29405): Start recognition "menu"
02-19 17:28:57.188: D/AndroidRuntime(29405): Shutting down VM
02-19 17:28:57.188: W/dalvikvm(29405): threadid=1: thread exiting with uncaught exception (group=0x418acda0)
02-19 17:28:57.198: E/AndroidRuntime(29405): FATAL EXCEPTION: main
02-19 17:28:57.198: E/AndroidRuntime(29405): Process: edu.cmu.pocketsphinx.demo, PID: 29405
02-19 17:28:57.198: E/AndroidRuntime(29405): java.lang.RuntimeException: Decoder_setSearch returned -1
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.PocketSphinxJNI.Decoder_setSearch(Native Method)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.Decoder.setSearch(Unknown Source)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.SpeechRecognizer.startListening(Unknown Source)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.switchSearch(PocketSphinxActivity.java:145)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.demo.PocketSphinxActivity.onPartialResult(PocketSphinxActivity.java:114)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.SpeechRecognizer$ResultEvent.execute(Unknown Source)
02-19 17:28:57.198: E/AndroidRuntime(29405): at edu.cmu.pocketsphinx.SpeechRecognizer$RecognitionEvent.run(Unknown Source)
02-19 17:28:57.198: E/AndroidRuntime(29405): at android.os.Handler.handleCallback(Handler.java:733)
02-19 17:28:57.198: E/AndroidRuntime(29405): at android.os.Handler.dispatchMessage(Handler.java:95)
02-19 17:28:57.198: E/AndroidRuntime(29405): at android.os.Looper.loop(Looper.java:157)
02-19 17:28:57.198: E/AndroidRuntime(29405): at android.app.ActivityThread.main(ActivityThread.java:5356)
02-19 17:28:57.198: E/AndroidRuntime(29405): at java.lang.reflect.Method.invokeNative(Native Method)
02-19 17:28:57.198: E/AndroidRuntime(29405): at java.lang.reflect.Method.invoke(Method.java:515)
02-19 17:28:57.198: E/AndroidRuntime(29405): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
02-19 17:28:57.198: E/AndroidRuntime(29405): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
02-19 17:28:57.198: E/AndroidRuntime(29405): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
02-19 17:28:57.198: E/AndroidRuntime(29405): at dalvik.system.NativeStart.main(Native Method)
问题出在哪里?我不会改变任何方法,变量或类型的代码。