Qoraalka akhriska ee Shiinaha

Waxaan naftayda u xilsaaray qorista ku-dhaqanka codka qoraalka ee Shiinaha.Tani waa arrin fudud oo fudud haddii aad horeba khibrad u leedahay, laakiin marka aad ka bilowdo inaad xoqdo, waxaad soo ururin doontaa dhibaatooyin badan oo rabitaanku laga yaabo inuu hore u baabi'iyo.JavaScript waa luqad aad u shaqeysa, waxaad mooddaa inay leedahay wax kasta oo qalbigaagu rabo.

Aynu eegno nooca ugu dambeeya ee aad ku dhejin karto DevTools oo aad hubiso.

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 - waa sida luqadda Shiinaha loogu qoondeeyay mindhicirrada browserka.Barnaamijkeena, waxaan ka raadinaa browserka si aan u helno codka luqadda Shiinaha, waxaanan isku daynaa inaan dib u soo saarno weedhayada.Dhab ahaantii kama duwana ku dhawaaqida luqad kale.Laakiin waxaa jira dhowr nuances halkan.Shaandhaynta noocyada kala duwan ee luqadaha la heli karo waxaan la kulannaa 2 cod oo Shiinees ah zh-CN.Eber wuxuu noqonayaa cod dhedig, kan ugu horreeyana waa cod lab ah.

Dheddig

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

Lab

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

Intaa waxa dheer, ku shaqaynta codku way ka duwanaan doontaa browserka ilaa browserka iyo qalab ilaa qalab.Browser-ka Chrome wuxuu leeyahay codad u gaar ah, browserka Edge gabi ahaanba wuu ka duwan yahay, kuwa aad u fiican, jidka, iyo browser-ka Opera ma laha wax cod ah gabi ahaanba, markaa ma jiri doonto wax cod ah.

Koodhkan waxa lagu dhejin karaa badhanka oo ku dhawaaqi karaa wax adiga kuu gaar ah.

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);
}

iyo koodka badhanka:

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

Ma jiraan wax dhibaato ah oo kale oo ku saabsan jilitaanka codka.Haa, sida ay u wada shaqeeyaan taleefannada casriga ah.Haa, weyn, gaar ahaan browserka Edge mobilka.Jid ahaan, iyadoo ku saleysan tignoolajiyadan, waxaan isku dayayaa inaan sameeyo adeeg-yar oo loogu talagalay barashada Shiinaha, waa kan:

http://jkeks.ru/china .Wax walba si sax ah ayaa loo fuliyaa sida aan halkan ku qeexay.





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