Pocketsphinx VS Google Speech Recognition API

4.9k views Asked by At

I am building a speech recognition android app that will act as a virtual personal assistant with tasks such as:

Make appointments/Reminders

Weather Info

General queries to Wolfram|Alpha / Wikipedia - (i.e Who directed Ghostbusters, whats the £-$ Exchange rate)

My question is wheather to use Pocketsphinx or the Google API?

Originally I set this up with "android.speech.RecognitionListener", worked great, however I want to implement Keyword spotting so the user doesn't need to have any interaction other than just speaking.

Apparently Google API doesn't support this, so I looked into using pocketsphinx for this, and still using google for the rest of the app (As I heard pocketsphinx is not as accurate?) However the two don't get along as they can't both occupy the microphone at the same time.

Is there a nice way to switch between recognizers? (cant even import both to same project)

Should I just go with pocketshinx and deal with the lower accuracy?

Suggestions would be helpful

Cheers

2

There are 2 answers

5
Aphire On BEST ANSWER

For anybody who wants to implement a similar project, I have found a work around. It's abit hacky and not entirely clean, but it works.

Using the android speech recognizer with a toggle on/off switch like in many examples across the web, when onResults comes back, the string will be checked for said "hotword", if it is not present, discard the string, if it is, process it. Once the query has been processed and the text to speech is responding, programatically reclick the toggle button, ensuring constant listening.

Do the same on "onError" as well. I did also have it onPartialResults as well, but it appeared to make the thread crash, not entirely sure why but once it was removed everything seems to work nicely.

0
Ievgen On

You can use pocketsphinx only to recognize predefined set of commands due to really poor accuracy (you should prepare your own dictionary and language model). Also pocketsphinx can be used offline and it is a big cons for some project.

In other hand google is very accurate but it's not free and works only online.