The following code has worked well for the last 2 months until yesterday it stopped reading Chinese texts, but it reads English texts despite the lang is zh-CN. Apparently it now only reads English. Having searched the internet and made a lot of changes and tries for about a day (loading and adding voices, adding the Chrome extension 'Chrome Speak' etc.), I still could not solve the issue. (Chrome Speak reads fine, but I couldn't figure out how to send it the text via javaScript)
var repete = 0;
function simpleSpeak(text, callback) {
var u = new SpeechSynthesisUtterance();
u.text = text;
u.lang = 'zh-CN';
u.rate = (repete % 2 == 0) ? 1 : 0.8;
repete++;
u.onerror = function (e) {
alert('error!')
if (callback) {
callback(e);
}
window.speechSynthesis.speak(u);
};
Can you please help me? OS: Windows Vista, Chrome Version 48.0.2564.97 m