Installing Pocketsphinx on Android

2019-02-07 08:29发布

I have some questions on installing Pocketsphinx on and Android phone, and I haven't been able to find answers on CMUSphinx's support forum, IRC, existing StackOverflow posts, or intensive Googling. If anyone here has a minute and would be willing to help, I'd greatly appreciate it.

First off, I'm confused as to whether I can even install Pocketsphinx on Android. I believe I need Java bins in order to run on Android, so I attempted to install Sphinx 4. To test the program, I made an empty activity and moved the HelloWorld demo file into the onCreate method.

Then, I added the following libraries to the build path:

  • js.jar
  • jsapi-1.0-base.jar
  • junit-4.8.1.jar
  • sphinx4.jar
  • tags.jar
  • WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar

The code deploys on a Droid 2 running Android 2.2, but I get the following error at runtime:

ERROR/AndroidRuntime(11567): Caused by: Property exception component:'wsjLoader' property:'location' - Can't locate resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz

I am including that jar file in the build path, so I'm not sure why that's causing an exception to be thrown. But then again, I'm not even sure I should be trying to install Sphinx 4 on Android. Does anyone know what I should do? Thanks in advance for your help.

5/2011 Update: The attempt I made to get pocketsphinx to run on Android is now listed on the CMU Sphinx wiki at http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/

5条回答
对你真心纯属浪费
2楼-- · 2019-02-07 08:56

Pocketsphinx on Android has been updated many times since then and got new features and capabilities. You can find the latest installation how to here:

http://cmusphinx.sourceforge.net/wiki/tutorialandroid

There is no need to do any complex installation now, you can just import the project in ADT and it should work.

查看更多
3楼-- · 2019-02-07 09:01

Not sure if you had this figured out but I have not read anywhere that you had to do this. So in case you are still having problems running PocketSphinx on the Android, what you need to do is to create the folders and upload the acoustics and language models to the locations specified in RecognizerTask.java.

查看更多
一纸荒年 Trace。
4楼-- · 2019-02-07 09:04

I saw that you spent some time getting PocketSphinx to run on android. Have you been able to reproduce the success of the mentioned 'brave soul'*?

But so far we get a SIGSEV :{ D/edu.cmu.pocketsphinx.demo.PocketSphinxDemo( 1455): Showing Dialog I/DEBUG ( 56): * ** * ** * ** * ** * ** * I/DEBUG ( 56): Build fingerprint: 'google/passion_vf/passion/mahimahi:2.2.1/FRG83D/291266:user/release-keys' I/DEBUG ( 56): pid: 1455, tid: 1475 >>> edu.cmu.pocketsphinx.demo <<< I/DEBUG ( 56): signal 11 (SIGSEGV), fault addr 0000001c I/DEBUG ( 56): #00 pc 00062192 /data/data/edu.cmu.pocketsphinx.demo/lib/libpocketsphinx_jni.so

查看更多
贼婆χ
5楼-- · 2019-02-07 09:19

Sphinx 4 tries to get the microphone from the system using libraries that only exist in the java VM, remember that Android runs on the Dalvik Machine...so basically you will never get the Hello demo to run on Android using Sphinx 4, I've tried that before... However I invite you to find out by yourself, just download the source code for sphinx instead of the jar, eventually you will get it to build but you will always get a runtime error wen trying to fetch the microphone...so it's pointless trying to use sphinx 4 on android...

查看更多
闹够了就滚
6楼-- · 2019-02-07 09:23

The error you got is because WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar must be extracted and the content must be put inside lib folder of your project

The error is because it is searching for a folder WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz inside lib. This folder is available inside the jar.

I have also only tried like this. But the thing for me is that now the apk is itself not loading states with a Installation error: INSTALL_FAILED_DEXOPT error. In my code a launcher activity creates a button, onclick of the button instance of helloworld would be created instead of main(), as I am using a constructor.

Previously I did like having an activity in the oncreate method, the entire data in the main() method of helloworld would be there. (Here I wasn't able to even create the ConfigurationManager instance some problem while loading the helloworld.config.xml

Your post seems to be like you were able to create those things and all. Could you share your code? Or just the framework of where you have the .config.xml files and what changes you had done in that.

查看更多
登录 后发表回答