本文介绍了Chrome的HTML5语音识别API实现中的语言代码是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 Chrome实施了HTML5语音识别API。支持多种语言。我想知道支持哪些语言以及HTML元素的 ) ar-OM / code>英语(印度) en-IN $ c>西班牙语(多米尼加共和国) es-DO es-EC > + 西班牙文(危地马拉) es-GT + 西班牙语(洪都拉斯) es-HN + SP anish(墨西哥) es-MX / strong> + 西班牙语(巴拿马) es-PA 西班牙语(巴拉圭) es-PY + 西班牙语(秘鲁) es-PE + 西班牙语(波多黎各) es-PR + 西班牙文(西班牙) es-ES + 西班牙文(美国) es-US + 西班牙语(乌拉圭) es-UY + 西班牙语(委内瑞拉) es-VE + strong> + 土耳其语 tr + 祖鲁祖 Chrome implemented the HTML5 speech recognition API. Many languages are supported. I wanna know which languages are supported and each language's corresponding code which is used in the HTML element's lang attribute.For instance:Polish (pl-PL)Turkish (tr-TR)Thank you! 解决方案 Ok, if it is not published, we can try to at least figure this out.Let me put this table for the beginning and we will refine it if someone has more information.I'm making assumption that supported languages shall be similar to those supported by voice search and that google uses standard language codes and does that consistently across its services.I've looked up languages supported by voice search on wikipediaI've found language codes here, on google language settings page and hereEDIT:I've experimented with backend voice recognition service. I've run a series of tests where I've passed the same english speech sample to the API but specified different dialect every time. It looks like:If a language is not supported, recognition falls back to en-US (looks like it recognizes that the sample is in english)If a dialect is not supported (or doesn't exist) recognition falls back to main dialect or en-US in some casesMain dialect can be specified just as first part of identifier. So 'en-US' and 'en' gives same results.Recognition for some languages, like chinese and japanese gives results in english, different from en-US though, which is strange. Probably the sample is different very much from chinese and the service is clever to figure that out.I treat a dialect as supported if recognition gives a different result from en-US and from main dialect for the language. Still, to verify it 100% we need to run samples for each language.Legend+ Most of all supported, because test gives a result different from en-US and main dialect..+ Absent on wikipedia but most of all supported, because test gives result different from en-US and main dialect.+? Most of all supported because it is listed on wikipedia. But test on my sample gives result identical to the main dialect. So either this is a coinsidense or language code is wrong..+? Not listed on wikipedia but looks like supported, because test gives result different from en-US and main dialect.Languages+ Afrikaans af+ Basque eu+ Bulgarian bg+ Catalan ca+ Arabic (Egypt) ar-EG+? Arabic (Jordan) ar-JO+ Arabic (Kuwait) ar-KW+? Arabic (Lebanon) ar-LB+ Arabic (Qatar) ar-QA+ Arabic (UAE) ar-AE.+ Arabic (Morocco) ar-MA.+ Arabic (Iraq) ar-IQ.+ Arabic (Algeria) ar-DZ.+ Arabic (Bahrain) ar-BH.+ Arabic (Lybia) ar-LY.+ Arabic (Oman) ar-OM.+ Arabic (Saudi Arabia) ar-SA.+ Arabic (Tunisia) ar-TN.+ Arabic (Yemen) ar-YE+ Czech cs+ Dutch nl-NL+ English (Australia) en-AU+? English (Canada) en-CA+ English (India) en-IN+ English (New Zealand) en-NZ+ English (South Africa) en-ZA+ English(UK) en-GB+ English(US) en-US+ Finnish fi+ French fr-FR+ Galician gl+ German de-DE+ Hebrew he+ Hungarian hu+ Icelandic is+ Italian it-IT+ Indonesian id+ Japanese ja+ Korean ko+ Latin la+ Mandarin Chinese zh-CN+ Traditional Taiwan zh-TW+? Simplified China zh-CN ?+ Simplified Hong Kong zh-HK+ Yue Chinese (Traditional Hong Kong) zh-yue+ Malaysian ms-MY+ Norwegian no-NO+ Polish pl+? Pig Latin xx-piglatin+ Portuguese pt-PT.+ Portuguese (brasil) pt-BR+ Romanian ro-RO+ Russian ru+ Serbian sr-SP+ Slovak sk+ Spanish (Argentina) es-AR+ Spanish(Bolivia) es-BO+? Spanish( Chile) es-CL+? Spanish (Colombia) es-CO+? Spanish(Costa Rica) es-CR+ Spanish(Dominican Republic) es-DO+ Spanish(Ecuador) es-EC+ Spanish(El Salvador) es-SV+ Spanish(Guatemala) es-GT+ Spanish(Honduras) es-HN+ Spanish(Mexico) es-MX+ Spanish(Nicaragua) es-NI+ Spanish(Panama) es-PA+ Spanish(Paraguay) es-PY+ Spanish(Peru) es-PE+ Spanish(Puerto Rico) es-PR+ Spanish(Spain) es-ES+ Spanish(US) es-US+ Spanish(Uruguay) es-UY+ Spanish(Venezuela) es-VE+ Swedish sv-SE+ Turkish tr+ Zulu zu 这篇关于Chrome的HTML5语音识别API实现中的语言代码是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-18 08:02