Menu

got error "pocketsphinx.h:no such file" when using command "ndk-build -B" in "Building Pocketsphinx On Android"

Help
2012-11-24
2013-10-04
  • xiaozhenzhu

    xiaozhenzhu - 2012-11-24
    1. put "sphinxbase", "pocketsphnix" and "PocketSphinxAndroidDemo" in the folder--"CMUSphinx".
    2. use commands "./autogen.sh", "./configure", "make", "make install" both in "sphinxbase" and "pocketsphnix", and looks functional.
    3. change "Android.mk" file.
    4. execute "ndk-build -B", got the error below:

    Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
    Gdbsetup : libs/armeabi/gdb.setup
    Compile thumb : pocketsphinx_jni <= pocketsphinx_wrap.c
    jni/pocketsphinx_wrap.c:760:26: fatal error: pocketsphinx.h: No such file or directory
    compilation terminated.
    make: *** [obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.c] Error 1

    I using root user in Fedora 16. Why there is no "pocketsphinx.h" file, maybe not generate it when "make"? And I found row 720 in "pocketsphinx_wrap.c", there is "#include pocketsphinx.h" and "#include sphinxbase/err.h". May someone give me a help?

     

    Last edit: xiaozhenzhu 2012-11-24
  • Nickolay V. Shmyrev

    Please read the documentation:

    http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/

    it says

    Open the Android.mk file, found in the jni folder, and change the SPHINX_PATH(line #5) to the parent folder holding pocketsphinx and sphinxbase.

    You missed this step

     
    • xiaozhenzhu

      xiaozhenzhu - 2012-11-24

      The three folders "pocketsphinx", "sphinxbase" and "PocketSphinxAndroidDemo" are in the path: "/home/xiaozhenzhu/Android/CMUSphinx".
      So i changed line #5 in "PocketSphinxAndroidDemo/jni/Android.mk" to: SPINX_PATH := $(HOME)/Android/CMUSphinx
      Am i right?

       
      • Nickolay V. Shmyrev

        Am i right?

        No, you can not use variables in Makefiles, you need to specify the absolute path:

        SPHINX_PATH := /home/xiaozhenzhu/Android/CMUSphinx
        
         
        • xiaozhenzhu

          xiaozhenzhu - 2012-11-24

          haha, this works!! Thanks a lot, Nickolay.

           
        • rompelstilchen2

          rompelstilchen2 - 2012-12-18

          but variables are definetely used in the original makefile (???)

           
  • rompelstilchen2

    rompelstilchen2 - 2012-12-18

    hello,

    sorry to dig this one, but i carefully followed the procedure but i still got the same error

    the root folder is /home/phil/arduino/sphinx/

    containing

    drwxrwxr-x 13 1000 1000 4096 Dec 18 08:52 pocketsphinx-0.8
    drwxr-xr-x 10 1000 1000 4096 Dec 18 09:24 PocketSphinxAndroidDemo
    drwxrwxr-x 11 1000 1000 4096 Dec 18 08:51 sphinxbase-0.8

    i modified Android.mk as :

    SPHINX_PATH := /home/phil/arduino/sphinx

    and this line too

    LOCAL_STATIC_LIBRARIES := pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil

    but as a result :

    /home/phil/arduino/sphinx/PocketSphinxAndroidDemo# ../../../android-ndk-r8c/ndk-build -B

    Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
    Gdbsetup : libs/armeabi/gdb.setup
    Compile thumb : pocketsphinx_jni <= pocketsphinx_wrap.c
    jni/pocketsphinx_wrap.c:760:26: fatal error: pocketsphinx.h: No such file or directory
    compilation terminated.
    make: *** [obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1

    plz help me :-(

     
  • Nickolay V. Shmyrev

    drwxrwxr-x 13 1000 1000 4096 Dec 18 08:52 pocketsphinx-0.8
    drwxr-xr-x 10 1000 1000 4096 Dec 18 09:24 PocketSphinxAndroidDemo
    drwxrwxr-x 11 1000 1000 4096 Dec 18 08:51 sphinxbase-0.8

    You should rename pocketsphinx-0.8 to pocketsphinx and sphinxbase-0.8 to sphinxbase. It should look like

    drwxrwxr-x 13 1000 1000 4096 Dec 18 08:52 pocketsphinx
    drwxr-xr-x 10 1000 1000 4096 Dec 18 09:24 PocketSphinxAndroidDemo
    drwxrwxr-x 11 1000 1000 4096 Dec 18 08:51 sphinxbase
    

    Then it will find the header appropriately.

     
    • rompelstilchen2

      rompelstilchen2 - 2012-12-18

      oh man it worked
      thank you soooo much

       
    • rompelstilchen2

      rompelstilchen2 - 2012-12-18

      i got a strange issue

      import edu.cmu.pocketsphinx.Config;
      import edu.cmu.pocketsphinx.Decoder;
      import edu.cmu.pocketsphinx.Hypothesis;
      import edu.cmu.pocketsphinx.pocketsphinx;

      cannot be resolved

      libpocketsphinx_jni.so is in obj/local/armeabi and libs/armeabi

      what am i missing ???

       
  • rompelstilchen2

    rompelstilchen2 - 2012-12-18

    anyone can help me with this ?
    i got a .so but no jar to include in the eclipse project

     
  • Nickolay V. Shmyrev

    libpocketsphinx_jni.so is in obj/local/armeabi and libs/armeabi

    There is nothing strange

    This issue is not related to JNI. It says that the java files for the corresponding classes are missing. Those files must be present in jni/edu/cmu/pocketsphinx, there should be files like Config.java and so on.

    If the files are present, you need to add them to a project build path. If files are missing you have the issues with swig. Swig must create them.

    anyone can help me with this ?

    Please be patient and follow the instructions precisely and it will work.

     
  • Patrick Tchankue

    I there!,
    I managed to compile the code after a couple of issues that I solved reading the above comment.
    When I try it out, it doesn't recognise anything I say.

    From the logcat, I see some Hypothesis

    06-17 19:49:24.860: D/edu.cmu.pocketsphinx.demo.RecognizerTask$AudioTask(20589): Posting 1024 samples to queue
    06-17 19:49:24.935: D/edu.cmu.pocketsphinx.demo.RecognizerTask(20589): Reading 1024 samples from queue
    06-17 19:49:25.735: D/edu.cmu.pocketsphinx.demo.RecognizerTask(20589): Hypothesis: what
    06-17 19:49:25.735: D/edu.cmu.pocketsphinx.demo.RecognizerTask(20589): Reading 1024

    Can someone help me figure out what is the problem?

    Thanks

     

    Last edit: Patrick Tchankue 2013-06-17
  • Nickolay V. Shmyrev

    Hello

    To allow others debug your accuracy issues you nee to provide more information. You need to uncomment "-rawlogdir" line in sources to enable the dump of raw files on sdcard. You need to share pocketsphinx.log file stored on sdcard and raw files collected in rawlogdir.

     
  • Patrick Tchankue

    Hi Nickolay,

    Thanks for the reply :). I have attached the pocketsphinx.log file to this post. I tried to analysed it but I don't understand the information that it contains.

     
  • Nickolay V. Shmyrev

    Beside pocketsphinx log you need to provide raw files.

     
    • Patrick Tchankue

      Ah sorry
      I have attached it here

       
      • Nickolay V. Shmyrev

        Your recording is too noisy to provide a good recognition of accented speech. Try to find a quiet place for your experiments.

         
        • Patrick Tchankue

          It is very strange because. I m in a room alone and there is not a lot of noise.
          I even copy some acoustic model from the wall street journal. The app crashes while trying to load them.

           
  • Ali Nazari

    Ali Nazari - 2013-08-30

    hi friends.
    i unzipped both Pocketsphinx and Sphinx under folder sphinx in somewhere on my hard drive.then did ./configure make and make install on both folders using cygwin.
    also i edited Android.mk file and changed local path to /cygdrive/c/sphinx next changed "sphinxutil sphinxfe sphinxfeat sphinxlm pocketsphinx" to "pocketsphinx sphinxlm sphinxfeat sphinxfe sphinxutil". the local path doesnt consist any extra spaces.
    and i have edited the path to swig 1.3 and ndk-r9e in properties of my project in builder section.Now when i build my project here is what i get:


    "Compile thumb : pocketsphinx_jni <= pocketsphinx_wrap.c
    C:/Users/Ali/workspace2/OVR//jni/pocketsphinx_wrap.c:760:26: fatal error: pocketsphinx.h: No such file or directory
    compilation terminated.
    make: *** [C:/Users/Ali/workspace2/OVR//obj/local/armeabi/objs/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1


    what should i do now?

     
    • charri

      charri - 2013-10-04

      Hello, I've got the same problem, i was wondering if u have solved it. thanks

       
  • charri

    charri - 2013-10-04

    Hi there!I've got a problem while building the PocketSphinxAndroidDemo in eclipse (im doing this in Windows). I thoroughly followed the steps in building it here: https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo . but its seems that i miss something that i dont know. Ive got the following error:

    "Compile thumb : pocketsphinx_jni <= pocketsphinx_wrap.c
    C:/Users/beautifulJeazel/Documents/Project/CMUSphinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c:751:26: fatal error: pocketsphinx.h: No such file or directory
    compilation terminated.
    make: *** [C:/Users/beautifulJeazel/Documents/Project/CMUSphinx/PocketSphinxAndroidDemo//obj/local/armeabi/objs/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1

    I followed the solution written in this forum but i think it doesn't apply in my case. Is there any alternative way to solve this? Or could anyone gave me another source where i could download the demo same as the version used in the tutorial? thanks in advance :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.