Skip to content

Use timeouts: Android Edge speechSynthesis.speak() could get stuck in speaking #36

@Falcosc

Description

@Falcosc

I don't have a demo, but I can create one based on this revision https://github.com/Falcosc/PSVR2-Twitch/tree/b07c03296f8073309820d2554e1ec71cdf33caa2

It took around 30 minutes of repeating a text every minute. I can't give more detailed information about how to reproduce. But you can download this revision, open index.html and connect to twitch and click start.
I don't know if it is related to fetch requests or if it happens without them too.

What happens?

  • speak does not trigger execute SpeechSynthesisUtterance onEnd
  • if you execute speak again, it does not start, it goes into pending
  • result is SpeechSynthesis state pending=true and speaking=true

Workaround:

  • execute speechSynthesis.cancel() and take care about your pending SpeechSynthesisUtterance objects
  • use a timeout like setTimout promise in a Promise.race

Maybe it is already handled in EasySpeech, they do an speechSynthesis.pause() and speechSynthesis.resume() from time to time. But maybe it is not, so make sure to guard your speak requests with timeouts if you deal with a known amount of text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions