Merhaba JS ücretsiz speech synthesis kullanarak bir metni seslendirtiyorum. Metin ingilizce olmasına rağmen telaffuzda hello , hav can yu diyerek türkçe okuyor metni bunu nasıl çözebilirim?
// Function to speak a message
function speakText(text, lang = 'en-US') {
if ('speechSynthesis' in window) {
const utterance = new SpeechSynthesisUtterance(text);
utterance.lang = lang;
window.speechSynthesis.speak(utterance);
} else {
console.warn('SpeechSynthesis API not supported in this browser.');
}
}