-
Notifications
You must be signed in to change notification settings - Fork 36
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
Delay speech-synthesis functions #127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we think this delay-everything model is the right one? I could see a few possibilities:
- Get no-op behavior for free based on document focus or user activation. (The speech synthesis spec doesn't seem to require these right now, but maybe implementations do?)
- Start in the paused state, and auto-resume upon activation.
- Be a bit smarter than just delaying. E.g., Allow cancel() while prerendering; allow pausing and resuming; allow using speak() to enqueue things; just avoid actually speaking.
For SpeechRecognition it seems more likely that delay-everything is correct, or maybe it should just auto-fail based on user activation/document focus.
Any idea what our implementation does?
Yea I see your point... The problem with all these suggestions and the reason I went with something a lot more basic is that the speech synthesis spec doesn't mention anything to do with multiple clients, I feel it's a conversation that should start at that spec's GitHub regardless of prerender and I wasn't sure whether to create a dependency, but that's maybe the right thing to do.
|
Yeah I agree we don't want to take on too large of a dependency here; we're not responsible for solving all the spec tech debt in everything we touch. IMO the right tradeoff here is:
|
The activation/focus gate is currently [in discussion[(https://github.com/WebAudio/web-speech-api/issues/35), and doesn't work the same across browsers. Firefox requires focus, Chrome uses the
Currently the implementation would throw a I'm becoming more convinced that the most straightforward solution is a simple |
I think I agree with that reasoning. I am slightly concerned Given the underspecification of all the methods you've decorated, it's hard to review for sure and make sure that delaying them will work as expected. (I.e., it seems like it'd require some sort of queue of actions, which is implicit in the speech spec but not explicit.) But this is probably good enough. |
See https://wicg.github.io/speech-api/#speechrecognition and https://wicg.github.io/speech-api/#tts-section.
Note that that API doesn't currently handle anything to do with document focus, which should be fixed separately.