user2532198
user2532198

Reputation: 11

Implementing CMU pocketsphinx android demo in android NDK with SWIG and JNI

I am facing problem in implementing cmu pocketsphinx recognition android demo in android NDK.

The error is

The import edu. cmu. pocketsphinx. Config cannot be resolved The import edu. cmu. pocketsphinx. Decoder cannot be resolved The import edu. cmu. pocketsphinx. Hypothesis cannot be resolved The import edu. cmu. pocketsphinx. pocketsphinx cannot be resolved

I am not sure this is the problem with SWIG or JNI

when i referred some website i came to know that SWIG as to generate above classes . Please let us how to handle SWIG and JNI on this issue

Thanks in advance

Upvotes: 1

Views: 844

Answers (1)

rmooney
rmooney

Reputation: 6229

I had a similar issue and I had to install SWIG then remake the pocketsphinx binary.

On Linux, this was:

sudo apt-get install swig
cd /pocketsphinx/
./configure
make
make install

After that I copied in the .java files from the /pocketsphinx/swig/edu/cmu/pocketsphinx/ to your Android project's jni/edu.cmu.pocketsphinx folder as seen in step 6 here (http://swathiep.blogspot.com/2011/02/offline-speech-recognition-with.html).

I still get compile errors on my ndk-build (I'm still working through it) but it sounds like this is what you needed.

Upvotes: 2

Related Questions