I want pocketsphinx to listen for certain keywords and do respective actions instead of going to the menu like their demo app. I have three keywords
private static final String KEYPHRASE1 = "good morning";
private static final String KEYPHRASE2 = "good evening";
private static final String KEYPHRASE3 = "good night";
This is my onPartialResult()
@Override
public void onPartialResult(Hypothesis hypothesis) {
if (hypothesis == null)
return;
String text = hypothesis.getHypstr();
}
I want to call some methods directly when it recognizes the three keywords. I also don't know whether I need to use switchSearch()
and KWS_SEARCH
like in the demo app.
I am new to android and I searched days for the answer. Someone, please help. This speech recognition is necessary for my app.