Search code examples
androidspeech-recognitionspeech-to-textapplication-settings

Android - Get Google Voice installed languages


I'm developing an android application that uses SpeechRecognition (Speech-to-text feature). It is possible to detect installed languages in settings through an intent?

Thanks you all!


Solution

  • Ok, maybe I've found a workaround. In the Intent init, I've added

    intent.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE,true);
    

    So, when I try to start SpeechRecognizer without the locale language downloaded, app returns

    SpeechRecognizer.ERROR_NETWORK
    

    error. In this way, I'm able to recognize whether a language is downloaded or not.