text-to-speech
text-to-speech copied to clipboard
You can't select a voice
You can still use it, but no voice selection on iPad running Safari.
Hi @Leia286
The voices are being fetched from the browser.
let voices = [];
window.speechSynthesis.onvoiceschanged = () => {
voices = window.speechSynthesis.getVoices();
speech.voice = voices[0];
let voiceSelect = document.querySelector("#voices");
voices.forEach((voice, i) => (voiceSelect.options[i] = new Option(voice.name, i)));
};
I'm not sure if Safari on iPad has different voices available.
I am able to use this JS file in a different TTS project https://github.com/Leia286/my-speech-app/blob/main/main.js Check it out. It's in JQuery. Maybe this might help?
@Leia286 I had the same problem with Chrome and Chromium. I fixed it and created a PR. Maybe this will fix your problem with Safari to. You are welcome to try my fork: https://github.com/KristjanESPERANTO/text-to-speech