问题
My current code below works fine when using the "ZH" ISO code for Mandarin but won't for Cantonese. This is the code below
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
String myLanguage= "yue";
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, myLanguage);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, myLanguage);
i.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, myLanguage);
回答1:
I got the code working, the dash just needed replaced with a underscore to make:
zh_HK
Thanks for your help Lilz.
回答2:
For Cantonese
try zh-HK
instead
Hope this helps
来源:https://stackoverflow.com/questions/19756700/how-to-set-cantonese-as-the-voice-search-language-in-a-app