Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft voices only loading on browser refresh in Chrome on Windows #255

Open
RandyLoeb opened this issue Jan 22, 2024 · 4 comments
Open

Comments

@RandyLoeb
Copy link

[X] I have read the FAQ section and have checked
that none of it describe the issue I'm about to report.

Describe the bug
A clear and concise description of what the bug is.

On the initial load of the page in latest Chrome on Windows 10 (not mobile), all the google voices available load, but not the 3 microsoft voices. But if users refresh the page, the 3 microsoft voices appear.

Additional context
[Add any other context about the problem here]

(https://longislandcw.github.io/morsebrowser/easysp23/).
Click/expand More Settings accordion-> check expert settings, check voice, and then see the list in "choose speaker..." (note that all non-english google voices are hidden from the user).

Brave and Edge seem ok, ie the microsoft voices load without need to refresh.

@RandyLoeb
Copy link
Author

RandyLoeb commented Jan 22, 2024

also this is how I use the library:

EasySpeech.init({ maxTimeout: 10000, interval: 250 }).then((e) => {
      this.logToFlaggedWords(`easyspeechinit: ${e}`)
      this.populateVoiceList()
    }).catch((e) => {
      this.logToFlaggedWords(`error in easyspeechinit: ${e}`)
    })

@RandyLoeb
Copy link
Author

well, a little workaround, the workflow for the page allows us to wait to call init until something is pressed. I am not sure if it is time, or the fact that user has clicked on something that enables the microsoft voices to be available.

@jankapunkt
Copy link
Member

@RandyLoeb sorry I missed this one in the last month. So here is the issue: all voices should have been loaded when init is complete as the underlying event voiceschanged is usually the only source of "truth" we can get.

One thing to try though, would be to see, if voiceschanged fired multiple times in your specific case:

  • first once most voices have loaded
  • second once the three MS voices have loaded

The code would be fairly easy to check:

const synth = window.speechSynthesis;

synth.addEventListener("voiceschanged", () => {
  // log output of synth.getVoices()
});

synth.getVoices() // sometimes required to initially trigger the voice list to update

@DanAndreasson
Copy link

Did anyone figure this out? We have this exact issue. voiceschanged only triggers once.

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

No branches or pull requests

3 participants