How to set Cantonese as the voice search language in a app?

橙三吉。 提交于 2019-12-20 05:34:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!