1

I am Currently working on a project to implement offline continuous speech recognition using pocketsphinx. I have developed it to the point where it recognizes the keyword I say, however the hypothesis in onPartialResults() and onResults() is not cleared and the words keep appending to the string. Therefore the code ahead keeps getting called infinitely.

Using hypothesis.setHypstr(""); or hypothesis.delete(); doesn't do anything.

I want it to wait in the background, whenever I say the keyword, it runs the code and wait in the background again.

1 Answers1

1

To clear hypothesis you need to stop recognizer and start listening again:

   recognizer.cancel()
   recognizer.startListening(searchName)

Check the code here for example

Recognizing multiple keywords using PocketSphinx

Bibin Johny
  • 3,157
  • 1
  • 13
  • 16
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • while listening same searchName again, hypothesis is not getting clear. Can anyone help me? – Gaurav Vachhani Jun 22 '16 at 09:26
  • Sure, but you need to provide the required information. What exactly are you doing and what is in logcat output. You need to create a separate question, not spam in an old one – Nikolay Shmyrev Jun 22 '16 at 13:42