androidspeech-recognitionpocketsphinx-android

CMU PocketSphinx Recognize a dynamically entered word


Is there a method in pocketSphinx library, which would allow me to take input a word [name,nickname] as text from the user and then it can recognize it when that word is said.

The flow would be - user inputs the word, then start the recognizer and when he says the word it is recognized. The word would not be common English word, rather would be a name or nickname.

Other option for me is gather all possible words in my region possible and make grammar for them, but obviously I would love a better solution. Pocket sphinx is used because continuous listening is required. Thank you.


Solution

  • You can add and delete keyword search any time, something like this:

    private static final String SEARCH_NAME = "kws";
    
    /* Word you want to check */
    public void recognizeWord(String word ) {
           recognizer.setKeyphrase(SEARCH_NAME, word);
           recognizer.setSearch(SEARCH_NAME);
           recognizer.startListening(SEARCH_NAME);
    }