5

我有一些关于在 Android 手机上安装 Pocketsphinx 的问题,我无法在 CMUSphinx 的支持论坛、IRC、现有的 StackOverflow 帖子或密集的谷歌搜索上找到答案。如果这里有人有时间并且愿意提供帮助,我将不胜感激。

首先,我对是否可以在 Android 上安装 Pocketsphinx 感到困惑。我相信我需要 Java bin 才能在 Android 上运行,所以我尝试安装 Sphinx 4。为了测试程序,我创建了一个空活动并将 HelloWorld 演示文件移动到 onCreate 方法中。

然后,我将以下库添加到构建路径:

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

该代码部署在运行 Android 2.2 的 Droid 2 上,但在运行时出现以下错误:

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

我在构建路径中包含了那个 jar 文件,所以我不确定为什么会导致抛出异常。但话又说回来,我什至不确定我是否应该尝试在 Android 上安装 Sphinx 4。有谁知道我应该怎么做?在此先感谢您的帮助。

5/2011 更新:我为让 pocketsphinx 在 Android 上运行所做的尝试现已列在 CMU Sphinx wiki 上,网址为http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/

4

5 回答 5

3

不确定您是否已经解决了这个问题,但我还没有读到您必须这样做的任何地方。因此,如果您在 Android 上运行 PocketSphinx 时仍然遇到问题,您需要做的是创建文件夹并将声学和语言模型上传到 RecognizerTask.java 中指定的位置。

于 2011-01-20T17:16:53.380 回答
2

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.

于 2014-05-24T19:58:55.497 回答
0

Sphinx 4 尝试使用仅存在于 java VM 中的库从系统中获取麦克风,请记住 Android 在 Dalvik 机器上运行......所以基本上你永远不会让 Hello 演示使用 Sphinx 4 在 Android 上运行,我'之前尝试过...但是我邀请您自己找出答案,只需下载 sphinx 的源代码而不是 jar,最终您将构建它,但在尝试获取麦克风时总是会出现运行时错误...所以尝试在 android 上使用 sphinx 4 毫无意义...

于 2012-03-09T09:01:07.810 回答
0

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.

于 2010-10-28T04:38:37.603 回答
0

我看到您花了一些时间让 PocketSphinx 在 android 上运行。您是否能够重现提到的“勇敢的灵魂”*的成功?

但到目前为止,我们得到了一个 SIGSEV :{ D/edu.cmu.pocketsphinx.demo.PocketSphinxDemo(1455): Showing Dialog I/DEBUG (56): ** * ** * ** * ** * ** * * I/DEBUG (56): 构建指纹: '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): 信号 11 (SIGSEGV), 故障地址 0000001c I/DEBUG (56): #00 pc 00062192 /data/data/edu.cmu.pocketsphinx .demo/lib/libpocketsphinx_jni.so

于 2011-01-27T18:27:43.510 回答