Custom grammar for Android speech recognition

2019-01-28 04:07发布

问题:

I am trying to apply the custom grammar for speech recognition. I have found a lot of documentation about android.speech.recognition package, it seams as the good place to start, but it seams that it doesn't exist in the Android SDK..

Is there a way to apply a custom grammar rules to the android speech recognition at all..?

回答1:

No, Android's recognizer intent only supports two language models. These are the "Free Form" model and the "web search" model. It does not support custom grammars.

See http://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_LANGUAGE_MODEL



回答2:

You may be able to use one of these libraries to do it:

Pocket Sphinx: http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/

or http://jvoicexml.sourceforge.net/