Search code examples
androidpocketsphinx

How to use pocketsphinx in Android Studio


I want to use pocketsphinx but I'm confuse .

1. I created a model.

2.inside my model I created main/jniLibs and copy all belows files and folders :

enter image description here

now, - I don't know where can I download pocketsphinx-android-5prealpha-nolib.jar file .

  • Should I use https://github.com/cmusphinx/pocketsphinx-android-demo as a library ?

  • in MainActivity I got these errors :

enter image description here


Solution

  • I think you should read over the Pocketsphinx on Android page.

    Using pocketsphinx-android

    Referencing the library in Android project

    Library is distributed as architecture-independent pocketsphinx-android-5prealpha-nolib.jar and binary .so files for different hardware architectures.

    In Android Studio you need to place jar file in app/libs folder and jni .so files into app/src/main/jniLibs folder.

    In other words, you seem to have missed the JAR file

    Otherwise, the other recommendation on that site is to simply clone the demo project, then build your app on top of it rather than copying code around into a new project.