2

I am trying to write a speech recognition program for Android, the most popular one for Windows seems to be here:https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo

The link for PocketsphinxAndroidDemo seems to be broken, so downloaded it from here, which I found here. If I use this version of PocketSphinxAndroid, it needs a lot of modification in the Eclipse project settings, however, at the end of the day, I was able to get it to work

But now I realize that PocketSphinxAndroid is just a user interface for the phone, while pocketsphinx and sphinxbase are the ones that are actually doing the speech recognition. Unlike Sphinx 4 (whichi s written in Java), they are written in C and so have to be compiled using the NDK, which is something I am not familier with. I was hoping to to use something such as Sphinx 4, written in java, but for the Android DVM.

So the question is, is a version of pocketsphinx available which is entirely written in Android Java, or is it possible to modify Sphinx 4 to work under android (for example, use Android'd AudioRecord instead of the Microphone class to get audio input samples)?

Community
  • 1
  • 1
user13267
  • 6,871
  • 28
  • 80
  • 138

1 Answers1

3

is there a version of pocketsphinx available which is entirely written in Android Java,

No, there is no such thing, pocketsphinx is written in C, not in java.

is it possible to modify Sphinx 4 to work under android (for example, use Android'd AudioRecord instead of the Microphone class to get audio input samples)?

Yes, it is possible. See for details:

https://sourceforge.net/p/cmusphinx/mailman/message/31316830/

There are attachment java files which implement everything required.

However, this system will be too slow for limited mobile device resources, it's better to use pocketsphinx for android, it's actually very easy to setup and you don not need any specific NDK knowledge for that. If you have issues with pocketsphinx setup on android, you are welcome to ask, see also

Why does PocketSphinx Android demo require cygwin

Community
  • 1
  • 1
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • Thank you for your answer. So the files `AudioTask.java` and `AndroidMicrophone.java` are available, but how exactly do I start using them? What should I do to get a small sample project of sphinx 4 working?For example, may be the `AndroidMicrophone.java` corresponds to the `Microphone` class and I can replace `Microphone` objects with `AndroidMicrophone` objects (more or less), but what is AudioTask? Is it like a sample `HelloWorld` equivalent for android? (it doesn't have an Activity class so i don't it is that) – user13267 Oct 14 '13 at 07:16