Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Wait for "onvoiceschanged" in Chrome #549

Open
stefan-niedermann opened this issue Oct 28, 2020 · 1 comment
Open

Wait for "onvoiceschanged" in Chrome #549

stefan-niedermann opened this issue Oct 28, 2020 · 1 comment

Comments

@stefan-niedermann
Copy link

According to the MDN docs one needs to wait in Chrome browsers for the onvoiceschanged event. This does not work on Firefox, therefore Mozilla suggests this approach:

var voices = [];

function populateVoiceList() {
  voices = synth.getVoices();
  // Now we have the voices.
}

populateVoiceList();
if (speechSynthesis.onvoiceschanged !== undefined) {
  speechSynthesis.onvoiceschanged = populateVoiceList;
}

It would be nice if the SpeechSynthesisService.getVoices() would return a Promise or an Observable.

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant