How should we handle when SpeechSynthesis is not available?
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
I found that it felt sketchy to have a getSynth() that could return null on a platform that doesn't support speech synthesis. We have some support for that case, but I think we rely on assertions a lot to guard against null pointer exceptions. In the wild, we wouldn't have assertions so we may want to be graceful. I added a couple of spots that checked if we had a synth before calling operations on it. Does this seem correct to you? I'd hate for the sim to break just because the platform doesn't have speech synthesis. For example, in the app, right?
Currently the only platform that does not support SpeechSynthesis is Android in a WebView. So correct, this could come up in the Android app, and it has! https://github.com/phetsims/qa/issues/608
I think this should hard crash and that it is up to us to not make SpeechSynthesis requests unless we are confident the platform can handle it. I almost want to replace the assertion in getSynth with an Error, I want it to let us know loudly on platforms where we expect the synth to be available but is not.
I can see both sides of the argument though. Lets talk more if you still prefer it to be graceful.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phetsims/utterance-queue
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
phetsims/utterance-queue#125 ·
-
phetsims/utterance-queue#122 · 2 comments · 1 assignee ·
-
phetsims/utterance-queue#121 · 1 assignee ·
-
Remove addToFront Open
phetsims/utterance-queue#120 · 1 assignee ·
-
dev:voicing type:i18n
Difficulty 5/5 Over a week Newbie friendliness 25/100
phetsims/utterance-queue#119 · 1 comment ·
All issues in phetsims/utterance-queue
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·