Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restricting the list of voice commands on Android to a predefined set

For Android, we have Google's voice input api's where we speak into the microphone and it outputs k most likely things that we said. Is there a way that, instead, we give voice input a set of valid "commands" or sentences and it outputs the most likely one?

For example, a list of valid commands would be:

"Play song" "Pause" "Next" "Previous"

However, no other words in the language would be considered as options.

Does anyone know how this could be accomplished?

like image 947
lrAndroid Avatar asked Nov 29 '25 04:11

lrAndroid


1 Answers

You can archive that with CMUSphinx, it could take a grammar specifying the language to recognize as a parameter for decoder:

            c.setString("-jsgf","grammar.jsgf");

The grammar is specified in JSGF format.

like image 98
Nikolay Shmyrev Avatar answered Nov 30 '25 17:11

Nikolay Shmyrev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!