Where's the Android Studio download for pocketsphinx?

Help
tikr
2014-08-13
2014-08-13
  • tikr

    tikr - 2014-08-13

    Hi,
    I'm developing in Android Studio and I've been trying to acquire a .jar file of pocketsphinx which is suitable for this IDE for at least two hours now.
    The Pocketsphinx android tutorial states: "Pocketsphinx is provided with prebuilt binaries and it's not easy to compile it on various platforms. You shouldn't build it unless you understand what you are doing. Use prebuilt binaries instead."
    However, the only download of prebuilt binaries I can find that contains a jar file is cmusphinx/files/pocketsphinx/5prealpha/pocketsphinx-android-demo-5prealpha.tar.gz/
    Unfortunately, it only contains the "-nolib" jar file which is suitable for the Eclipse ADT plugin, but not for Android Studio.

    After this, I downloaded the sources, ant, swig etc with the intention to just compile it myself. However this doesn't work in Windows either. The java files get compiled, but ant then exits with the message that the NDK binary is not a win32 executable.

    Long story short: Why is there no simple download option for the jar file which is needed when developing in Android studio? Or does it exist and I just didn't find it? Any help would be greatly appreciated. It's kind of frustrating to waste so much time on just downloading the library.

     
  • Nickolay V. Shmyrev

    However, the only download of prebuilt binaries I can find that contains a jar file is cmusphinx/files/pocketsphinx/5prealpha/pocketsphinx-android-demo-5prealpha.tar.gz/

    This is a correct download.

    Unfortunately, it only contains the "-nolib" jar file which is suitable for the Eclipse ADT plugin, but not for Android Studio.

    It is suitable for Android Studio too, you just need to import this project properly and arrange the jni so file.

    After this, I downloaded the sources, ant, swig etc with the intention to just compile it myself. However this doesn't work in Windows either

    If you don't understand how NDK works you probably should stick with prebuilt binaries.

     
  • tikr

    tikr - 2014-08-13

    I've been using the NDK for quite a while, but with my own code, so I know how it works. Thanks for the advice however ;) The ant build script tries to execute the ndk-build binary in the ndk's folder which is not a windows32 executable, I can't change that, so it's most definitely not my fault that the manual compilation isn't working.

    Sticking with the prebuild binaries is what I'm trying to do, however the guide explicitly states that the -nolib jar file is for Eclipse and that it's NOT the android studio version.

    There are also several stackoverflow posts about this, e.g.
    http://stackoverflow.com/questions/24593034/pocketsphinx-android-studio

    If you know how to run the lib in Android Studio, why don't you just explain it for all the people who are searching for a guide to do it instead of just posting "you have to do it the right way"?

     
    Last edit: tikr 2014-08-13
  • tikr

    tikr - 2014-08-13

    http://sourceforge.net/p/cmusphinx/code/HEAD/tree/trunk/pocketsphinx-android/

    This is an extract of the official README for the file:

    "Using in Android Studio or from command-line
    Simply put regular version of the jar library into 'libs' directory of your project."

    There is no "regular version" included.

     
    Last edit: tikr 2014-08-13
  • Nickolay V. Shmyrev

    The ant build script tries to execute the ndk-build binary in the ndk's folder which is not a windows32 executable, I can't change that,

    ndk-build must be an executable, you probably downloaded ndk for wrong platform. Or you need to add exe extension.

    Sticking with the prebuild binaries is what I'm trying to do, however the guide explicitly states that the -nolib jar file is for Eclipse and that it's NOT the android studio version.

    I'm not sure why are you confused with nolib in jar name, it just means that jar doesn't include jni file. You still can use that jar in studio.

    why don't you just explain it for all the people who are searching for a guide to do it instead of just posting "you have to do it the right way"?

    1) Download and unpack archive
    2) Import Eclipse project in Android studio
    3) Read import summary and see that custom build script assets.xml was not imported
    4) copy assets.xml manually to app subfolder
    5) Edit app/build.gradle with the following to run custom build script:

    ~~~~~~~~~~~~
    ant.importBuild 'assets.xml'
    preBuild.dependsOn(list, checksum)
    clean.dependsOn(clean_assets)
    ~~~~~~~~~~~~~~~

    6) Run, it should work

    In case you still have trouble you can download android studio project here:

    http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/5prealpha/pocketsphinx-android-demo-5prealpha-android-studio.tar.gz/download

     
  • tikr

    tikr - 2014-08-13

    Thanks!
    Just before reading your post I figured it out myself. It's actually pretty easy and works without importing the sample project. The .jar goes into the /libs folder of the Android Studio project, the .so files go into /srd/jniLibs. That's it, Android Studio does everything else automatically.
    The reason I was confused is because the READMEs and tutorials on the website state that another jar file has to be used.

    Thanks anyway for your help!

     
  • Alexander Solovets

    You was right, we used to host both regular and -nolib versions in a single archieve, but now for some reason we do not. We'll either include full .jar or will change the tutorial.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks