我试图将PocketSphinx与VuforiaSampleDemo应用程序结合起来。我已经在Ubuntu上运行的Eclipse中安装了单独的项目,它们可以独立工作。
然而,当我尝试通过复制相应的代码行和方法将PocketSphinx合并到其他应用程序(Vuforia ImageTargets包)时,我遇到了崩溃。
当代码执行该行时,似乎发生了崩溃:
recognizer = defaultSetup().setAcousticModel(new File(modelsDir, "hmm/en-us-semi"))
.setDictionary(new File(modelsDir, "dict/cmu07a.dic"))
.setRawLogDir(assetsDir)
.setKeywordThreshold((float) 0.01)
.setSampleRate(16000)
.getRecognizer();
我已将资产从PocketSphinx复制到Vuforia应用程序。任何人都可以对此有所了解吗?感谢。
这是我的LogCat输出:
09-10 11:12:52.447: W/ApplicationPackageManager(3027): getCSCPackageItemText()
09-10 11:12:52.457: I/PersonaManager(3027): getPersonaService() name persona_policy
09-10 11:12:52.487: D/ImageTargets(3027): onCreate
09-10 11:12:52.497: W/ContextImpl(3027): Failed to ensure directory: /storage/extSdCard/Android/data/com.qualcomm.vuforia.samples.VuforiaSamples/files
09-10 11:12:52.497: I/Assets(3027): Skipping asset models/hmm/en-us-semi/sendump: checksums are equal
09-10 11:12:52.497: I/Assets(3027): Skipping asset models/hmm/en-us-semi/mdef: checksums are equal
09-10 11:12:52.497: I/Assets(3027): Skipping asset models/hmm/en-us-semi/README: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/hmm/en-us-semi/feat.params: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/hmm/en-us-semi/means: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/grammar/commands.keywords: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/hmm/en-us-semi/noisedict: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/lm/weather.dmp: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/grammar/commands.gram: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/hmm/en-us-semi/variances: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/hmm/en-us-semi/transition_matrices: checksums are equal
09-10 11:12:52.507: I/Assets(3027): Skipping asset models/dict/cmu07a.dic: checksums are equal
09-10 11:12:52.517: W/dalvikvm(3027): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Ledu/cmu/pocketsphinx/SpeechRecognizerSetup;
09-10 11:12:52.517: D/AndroidRuntime(3027): Shutting down VM
09-10 11:12:52.517: W/dalvikvm(3027): threadid=1: thread exiting with uncaught exception (group=0x41730da0)
09-10 11:12:52.517: E/AndroidRuntime(3027): FATAL EXCEPTION: main
09-10 11:12:52.517: E/AndroidRuntime(3027): Process: com.qualcomm.vuforia.samples.VuforiaSamples, PID: 3027
09-10 11:12:52.517: E/AndroidRuntime(3027): java.lang.UnsatisfiedLinkError: Couldn't load pocketsphinx_jni from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.qualcomm.vuforia.samples.VuforiaSamples-142.apk,libraryPath=/data/app-lib/com.qualcomm.vuforia.samples.VuforiaSamples-142]: findLibrary returned null
09-10 11:12:52.517: E/AndroidRuntime(3027): at java.lang.Runtime.loadLibrary(Runtime.java:358)
09-10 11:12:52.517: E/AndroidRuntime(3027): at java.lang.System.loadLibrary(System.java:526)
09-10 11:12:52.517: E/AndroidRuntime(3027): at edu.cmu.pocketsphinx.SpeechRecognizerSetup.<clinit>(Unknown Source)
09-10 11:12:52.517: E/AndroidRuntime(3027): at com.qualcomm.vuforia.samples.VuforiaSamples.app.ImageTargets.ImageTargets.setupRecognizer(ImageTargets.java:155)
09-10 11:12:52.517: E/AndroidRuntime(3027): at com.qualcomm.vuforia.samples.VuforiaSamples.app.ImageTargets.ImageTargets.onCreate(ImageTargets.java:120)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.Activity.performCreate(Activity.java:5389)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.ActivityThread.access$800(ActivityThread.java:163)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.os.Handler.dispatchMessage(Handler.java:102)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.os.Looper.loop(Looper.java:157)
09-10 11:12:52.517: E/AndroidRuntime(3027): at android.app.ActivityThread.main(ActivityThread.java:5335)
09-10 11:12:52.517: E/AndroidRuntime(3027): at java.lang.reflect.Method.invokeNative(Native Method)
09-10 11:12:52.517: E/AndroidRuntime(3027): at java.lang.reflect.Method.invoke(Method.java:515)
09-10 11:12:52.517: E/AndroidRuntime(3027): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
09-10 11:12:52.517: E/AndroidRuntime(3027): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
09-10 11:12:52.517: E/AndroidRuntime(3027): at dalvik.system.NativeStart.main(Native Method)
09-10 11:12:54.407: I/Process(3027): Sending signal. PID: 3027 SIG: 9