How to set the language in speech recognition on android?

前端 未结 8 1348
清歌不尽
清歌不尽 2020-11-28 06:00

I\'ve been working on speech Recognition API in android and found out that the speech results vary allot when the language settings are changed , is there a way to set it pr

8条回答
  •  暖寄归人
    2020-11-28 07:03

    I tried to use

    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
    

    but it did not work for me (did not take the system language). Helped here like this:

    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault().toString());
    

提交回复
热议问题