7

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

Aphire
  • 1,621
  • 25
  • 55
  • 1
    What is your problem in implementing wake-up word with pocketsphinx and then switching to google recognizer by stopping audio recording with pocketsphinx ? – Florent Nov 21 '14 at 16:42
  • They can't both be imported into the same project as far as I can tell, however I feel I may have solved the issue in the past 5 minutes, when I understand the why and how a bit more, I will post an answer here for future people to benefit – Aphire Nov 21 '14 at 17:24
  • Pocketsphinx is comically bad compared to GSR. You'd get better results by sampling /dev/random. – Cerin Dec 09 '14 at 02:43

2 Answers2

1

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.

Aphire
  • 1,621
  • 25
  • 55
  • I did yes in the end, haven't touched the project for almost two years though – Aphire Jun 15 '16 at 08:17
  • 1
    No problem, any questions i'll gladly try and answer (although my info might be out of date!) – Aphire Jun 15 '16 at 12:13
  • Do we need to use thread for text to speech and speech to text ? text to speech is not working when i call speech to text ? can you please help me – Spartan Jun 18 '16 at 13:47
  • @Aphire Can I get a link to the code implementing particularly this part? – Sushovan Mandal Feb 07 '18 at 14:55
  • @SushovanMandal I'm afraid I don't have access to it anymore as I don't work for the company I was writing it for anymore. Sorry! – Aphire Feb 07 '18 at 15:50
0

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.

Ievgen
  • 4,261
  • 7
  • 75
  • 124