I am designing an application with HTML and JS that uses Electron as the browser, (Electron allows me to have a transparent window). Everything works well, except I cannot seem to change the default voice from Microsoft David regardless of what my code says. Would anyone be able to shed some light on things I could try/what I could do?
Tried relocating where the speechsynthesis was called from, changing the array number.
speechSynthesis.addEventListener('voiceschanged', myFunction(Test));
var msg = new SpeechSynthesisUtterance("Testing");
var voices = window.speechSynthesis.getVoices();
var voice = speechSynthesis.getVoices();
speechSynthesis.getVoices().forEach(function(voice) {
console.log(voice.name, voice.default ? voice.default : '');
});
msg.pitch = 1.1;
msg.volume = 1;
msg.rate = 0.85;
msg.lang = 'en-US';
msg.voice = voices[5];
window.speechSynthesis.speak(msg);
I would expect the code to change the default voice from David to Zira. I cannot deviate away from David.