javascript change voice language

Solutions on MaxInterview for javascript change voice language by the best coders in the world

showing results for - "javascript change voice language"
Alessandra
19 Aug 2016
1let utterance = new SpeechSynthesisUtterance('Ciao');
2utterance.lang = 'it-IT'; /*To set the voice in Italian*/
3speechSynthesis.speak(utterance);
4
5/*The value has to be in BCP 47 language tag, here is a list of all languages :
6https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers*/
7
8/* Some of the principal languages :
9English, United States : en-US
10German, Germany : de-DE
11Spanish : es-ES_tradnl
12French, France : fr-FR
13Japanese, Japan : ja-JP
14Portuguese, Brazil : pt-BR
15Russian, Russian Federation : ru-RU
16Hindi, India : hi-IN
17Chinese, China : zh-CN
18English, United Kingdom : en-GB */
19
20/*And don't forget to upvote answers that help you!*/