function speakText() {
const item = vocabulary[currentVocabularyIndex];
var text = item.arabic;
if(problemWords.includes(text) == true){ // Special case
console.log("Special voice case for this word (" + text + ")");
const audioFile = new Audio('/specialCaseAudioFiles/' + item.transliteration + '.mp3');
audioFile.play();
} else {
const utterance = new SpeechSynthesisUtterance(text);
utterance.lang = 'ar-SA'; // Set the language to Saudi Arabian Arabic
utterance.rate = 0.8;
if ('speechSynthesis' in window) {
window.speechSynthesis.cancel();
window.speechSynthesis.speak(utterance);
} else {
console.log("Speech synthesis not supported in this browser.");
}
}
}
I’ve had a problem with the text to speech on only samsung chrome. It works fine in desktop chrome, and on my family’s oneplus 9t and pixel 6 pro. I tried it on 3 samsung phones, an s10+, a fold 3 and a s21 but none of their text to speech worked. Anyone know how to fix this or what the problem is?
I USED CHROME ON THE SAMSUNG PHONES AND NOT SAMSUNG INTERNET