Android SpeechRecognizer not working with Chinese

11 views Asked by At

I can't get the SpeechRecognizer to work with Chinese even though I have the language downloaded under "Offline Voice Recognition" under google settings.

Other languages like English work fine. I am currently trying to set the language as such:

putExtra(RecognizerIntent.EXTRA_LANGUAGE, "zh-CN")

But unfortunately it doesn't work - I have tried every combination, including zh, zh-CN, cmn-Hans-CN, etc.

On my AVD Pixel 8 with API 34 I get error code 12 which is ERROR_LANGUAGE_NOT_SUPPORTED On my physical device, a OnePlus 6T running Android 11 I get error code 5 which is ERROR_CLIENT.

Is there any way I can get more information out in other logs or similar? Have also tried the following:

putExtra(RecognizerIntent.EXTRA_LANGUAGE, "zh-CN");
putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "zh-CN");
putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "zh-CN");
putExtra(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES, "zh-CN");
putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, "zh-CN");
putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, "zh-CN");
putExtra(RecognizerIntent.EXTRA_RESULTS, "zh-CN");

But it makes no difference. I have only managed to have it run with Chinese (although with poor quality recognitions) on my old Nexus 5X running Android 6 when using cmn-Hans-CN.

Interestingly also when sending a Broadcast with intent RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS I receive the list of supported languages on the Nexus 5x but not on the AVD Pixel 8 - the results bundle is entirely empty. On the OnePlus it doesn't even log as receiving the broadcast at all.

Any help is greatly appreciated.

0

There are 0 answers