Kuverenga zvinyorwa muChinese



Ndakazvigadzirira basa rekunyora izwi richiita zvechinyorwa muchiChinese.Iyi inyaya yakapusa kana iwe uchitova neruzivo, asi kana uchinge watanga kuzviita kubva pakutanga, unounganidza matambudziko akawanda zvekuti chishuwo chinogona kunyangarika kare.JavaScript mutauro unoshanda chaizvo, unoratidzika kunge une zvese zvinodiwa nemoyo wako.

Ngatitarisei iyo yekupedzisira vhezheni yaunogona kunamira muDevTools uye woitarisa kunze.

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 - iyi ndiyo nzira iyo mutauro weChinese unosarudzwa mumatumbo ebrowser.Muchirongwa chedu, tinotsvaga izwi remutauro weChinese mubrowser, uye edza kuburitsa mutsara wedu.Hazvina kumbosiyana nokutaura chero mumwe mutauro.Asi pane akati wandei nuances pano.Tichisefa ruzhinji rwemitauro iripo tinosangana nemanzwi maviri echiChinese zh-CN.Zero richava izwi rechikadzi, uye rekutanga izwi rechirume.

Mukadzi

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

Murume

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

Uye zvakare, kuita kwezwi kuchasiyana kubva kubrowser kuenda kubrowser uye kubva kune mudziyo kuenda kune mudziyo.Iyo Chrome browser ine manzwi ayo, iyo Edge browser ine zvakasiyana zvachose, zvinofadza zvakanyanya, nenzira, uye Opera browser haina manzwi zvachose, saka hapazove nezwi rinoita.

Iyi kodhi inogona kusungirirwa pabhatani uye taura chimwe chinhu chako.

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

uye bhatani kodhi:

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

Hapana mamwe matambudziko nekuita kwezwi.Ehe, zvese zvinoshanda sei pane smartphones.Ehe, hongu, kunyanya mune mobile Edge browser.Nenzira, zvichibva pane tekinoroji iyi, ndiri kuyedza kugadzira microservice yekudzidza chiChinese, hezvino izvi:

http://jkeks.ru/china .Zvese zvinoitwa sezvandatsanangura pano.





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