0

I am really new to the java & android apps development. Currently I'm doing a prototype application about the voice recognition. Which use the sphinx4 speech recognition. I'm really no idea that, is that Sphinx4 can be used on the android SDK?

Using Sphinx4.0 to build a speech recog. Android application (this shows that, it can't) https://sourceforge.net/p/cmusphinx/discussion/sphinx4/thread/ce6ee093/ (But this said it can.)

if yes, i really no idea how to make use of the sphinx4, anyone can kindly provide the guide for me to complete the prototype? Thanks for your kindly help.

Community
  • 1
  • 1
Ngong99
  • 23
  • 1
  • 5
  • you need to use: -pocketsphinx on the device -sphinx on a server and use data on the phone to access the device -googles speech to text api's which are far superior in quality http://developer.android.com/reference/android/speech/SpeechRecognizer.html – Alex Aug 23 '13 at 18:07

2 Answers2

2

It is possible to run Sphinx4 on android, however, you need to remove sphinx4 parts that use desktop-specific java api like java sound API. You still can have the core in place and demo should work as expected.

You need to reimplement Microphone class to use android API for sound input.

For more details see the discussion about that:

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

So it is some work and it requires coding skills. If you don't have that, use pocketsphinx instead like Opiatefuchs suggests you. It's well documented approach which requires minimum efforts.

Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
0

I also tried to do some App with Pocketsphinx, not Sphinx4. I think this is really not designed for android, but maybe You could get it work. But for which reason? PocketSphinx is a good designed API for including in Android. I had mad some tutorial on my website for how to get the Pocketsphinx work, I advise to stop thinking about Sphinx4 because it would be a heavy coding thing to get it work. PocketSpinx has all You need...look at my Tutorial, this is a better way:

https://sites.google.com/site/opiatefuchs/home/pocketsphinxandroiddemo

Until now I stopped working on it, but when I got time, I will start to include Pocketsphix into an apk. But this tut only shows how to get the example demo work and set up Your runtime environment to work with Pocketsphinx.

Opiatefuchs
  • 9,800
  • 2
  • 36
  • 49
  • But is it possible to convert a recorded audio files to text using SPINKS 4 and POCKETSPHINX... – Abhijit Chakra Sep 17 '13 at 09:58
  • I think this is a hard task. Because of the audio types like mono and stereo, it is not easy to sound text out of a audio file. This is discussed here: http://stackoverflow.com/questions/2319735/voice-recognition-on-android-with-recorded-sound-clip – Opiatefuchs Sep 18 '13 at 11:54
  • I followed the instructions on your website (very ice and detailed tutorial by the way, thank you for all your effort); however, since the PocketSphinx link in your tutorial is broken, I had to get it from https://github.com/cesine/AndroidPocketSphinx. To get this to work I had to change a lot of things (especially paths for swig; if I use AndroidPocketSphinx from thsi source, I cannot leave the path to swig at default as instructed in your tutorial). Finally I did manage to get the program running, but if I press and hold on the `hold and speak` button, the program crashes – user13267 Oct 11 '13 at 10:27
  • This is the error I get in logcat: Fatal signal 11 (SIGSEGV) at 0x0000001c (code=1), thread 16283 (Thread-509). From this post, http://stackoverflow.com/questions/17211933/fatal-signal-11-sigsegv-at-0x00000000-code-1-thread-32140, it seems to be some kind of memory allocation error, but I have no idea what it exactly means. – user13267 Oct 11 '13 at 10:28