Faitauina o tusitusiga ile gagana Saina



Na ou faia ia te aʻu le galuega o le tusiaina o le leo o le tala i le gagana Saina.O se mataupu faigofie lava pe afai ua uma ona e maua le poto masani, ae a amata ona e faia mai le sasa, o le ae aoina le tele o faʻafitauli e ono mou atu le manaʻo i se taimi vave.O le JavaScript o se gagana e sili ona aoga, e foliga mai o loʻo i ai mea uma e manaʻo ai lou loto.

Sei o tatou tilotilo i le faʻauʻuga mulimuli e mafai ona e faʻapipiʻi i totonu o le DevTools ma siaki i fafo.

var utterance = new SpeechSynthesisUtterance('菜');
var voices = window.speechSynthesis.getVoices();
utterance.voice = voices.filter(function(voice) { return voice.lang == 'zh-CN'; })[0];
window.speechSynthesis.speak(utterance);

zh-CN - o le auala lea e faʻailoa ai le gagana Saina i totonu o le manava o le suʻega.I la matou polokalame, matou te suʻeina le suʻesuʻega mo le leo o le gagana Saina, ma taumafai e toe faia a matou fuaitau.E toetoe lava a leai se eseesega mai le faaleoina o se isi gagana.Ae o loʻo i ai ni nai nuances iinei.Filifilia le tele o gagana avanoa matou te maua ai leo 2 Saina zh-CN.Zero o le a avea ma leo fafine, ma le muamua o le leo tama.

Fafine

utterance.voice = voices.filter(function(voice) { return voice.lang == 'zh-CN'; })[0];

Male

utterance.voice = voices.filter(function(voice) { return voice.lang == 'zh-CN'; })[1];

E le gata i lea, o le leo galue o le a ese mai le browser i le browser ma mai lea masini i lea masini.O le Chrome browser ei ai ona lava leo, o le Edge browser e matua ese lava, sili atu ona manaia, i le ala, ma le Opera browser e leai se leo, o lea o le a leai se leo galue.

O lenei code e mafai ona tautau i luga o le ki ma fa'aleo se mea e oe lava.

function say(voiceId){
    let text = document.getElementById("pole").innerHTML
    console.log (text)
    var utterance = new SpeechSynthesisUtterance(text);
    var voices = window.speechSynthesis.getVoices();
    utterance.voice = voices.filter(function(voice) { return voice.lang == 'zh-CN'; })[voiceId];
    window.speechSynthesis.speak(utterance);
}

ma le faamau code:

<button onclick="say(1)">👨🔉</button>

E leai ni isi fa'afitauli i le fa'atinoina o le leo.Oi ioe, faʻafefea ona aoga uma i luga o telefoni feaveaʻi.Ioe, lelei, aemaise lava ile masini feaveaʻi Edge browser.Ile auala, faʻavae i luga o lenei tekinolosi, o loʻo ou taumafai e fai se microservice mo le aʻoaʻoina o le Saina, o le mea lea:

http://jkeks.ru/china .O mea uma e faʻatinoina tonu e pei ona ou faʻamatalaina iinei.





bg bs ca ceb co cs cy da de el en eo es et fa fi fr fy ga gd gl gu ha haw hi hmn hr ht hu id ig is it iw ja jw ka kk km kn ko ku ky la lb lo lt lv mg mi mk ml mn mr ms mt my ne nl no ny or pa pl ps pt ro ru rw sd si sk sl sm sn so sr st su sv sw ta te tg th tk tl tr tt ug uk ur uz vi xh yi yo zh zu
Text to speech
QR-Code generator
Parsedown cheatsheet. Markdown
Filter data by column with regular expressions
Engines for creating games on LUA ?
JavaScript: draw a point
JavaScript: Speaking text in Chinese