Android: PocketSphinx speech/voice recognition library in background.

Published by Igor Khrupin on

As you know we have Google Voice for voice recognition.

Here is simple way to implement offline speech recognition using PocketSphinx lib.

I’ve created simple app which will run Service with speech recognition functionality.

You can add one keyword here:

recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE);

Sure PocketSphinx have multi-keyword functionality.

File menuGrammar = new File(assetsDir, "voicecommands.gram");
recognizer.addGrammarSearch(VOICE_COMMAND, menuGrammar);

But for me it is’t perfect.

One-word mode works better.

Use PocketSphinx if you need only one-keyphrase recognition.

Here is full documentation:

My sample project on github

Download it from github


Daksh · 17 August, 2017 at 17:20

you have a bug in a sample which is that once the key phase is said it keeps repeating the command set for if text contains keyphase can you please help me

chaithra · 1 March, 2018 at 15:10

Key phrase is said it keeps repeating in the text, can anyone please help me to fix this issue?

Leave a Reply to Daksh Cancel reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.