text-to-speech icon indicating copy to clipboard operation
text-to-speech copied to clipboard

You can't select a voice

Open Leia286 opened this issue 3 years ago • 3 comments

You can still use it, but no voice selection on iPad running Safari.

Leia286 avatar Oct 10 '21 19:10 Leia286

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.

zolomohan avatar Oct 10 '21 21:10 zolomohan

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 avatar Oct 10 '21 21:10 Leia286

@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

KristjanESPERANTO avatar Jan 09 '22 18:01 KristjanESPERANTO