-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add initial support for JS SpeechSynthesisErrorEvent #823
Add initial support for JS SpeechSynthesisErrorEvent #823
Conversation
09a1549
to
d5e29c3
Compare
1) Add new type SpeechSynthesisErrorEvent and expose it to JS 2) Extend PlatformSpeechSynthesizer speakingErrorOccured with error type arg 3) Send proper JS event on error condiditon 4) Stick to using older SpeechSynthesisEvent for platforms that doesn't support ErrorEvent yeti (mac)
d5e29c3
to
0abbe61
Compare
There's an upstream commit from March in WebKit/WebKit@c8a7a8619b280 that adds a < Conditional=SPEECH_SYNTHESIS
---
> Conditional=SPEECH_SYNTHESIS,
> Exposed=Window
45c31,33
< readonly attribute SpeechSynthesisErrorCode error;
---
> constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict);
>
> readonly attribute SpeechSynthesisErrorCode error; Among other changes, the upstream version matches the spec at https://wicg.github.io/speech-api/#speechreco-error with an extra implementation-specific I tried applying it but couldn't test properly, as I didn't manage to get speech synthesis enabled in my WPE build (desktop). Is there any pending patch I could use to test it? Or another environment (e.g. buildroot)? |
Hi, thanks for your replay. I was not aware of an upstream patch. Indeed my patch misses SpeechSynthesisErrorEventInit dict initializer for ErrorEvent that is present in upstream version. On the other hand the other implementation doesn't allow to trigger different error codes from platform implementation so effectively only peechSynthesisErrorCode::Canceled is used (unless I miss something in the code). For the testing, WPE doesn't have any default PlatformSpeechSynthesizer implementation so the code won't be able to compile probably after enabling speech synthesis option. We do have our own implementation based on platform specific stuff but this is very Comcast specific. Currently there is only some mac implementations but not sure if we are able to use this (error event code is generic so any platform would be fine to test) or the mock version just to see the flow... |
Hi @asurdej-comcast sorry for the delay. It's on my list for this week.
I'm thinking of giving a try and adding some mocks just to see if things get compiled to make it easier to track failures. |
I've put the WIP backport in https://github.com/lauromoura/WPEWebKit/tree/speech-error-event-backport And the upstream speech synth stubs in https://github.com/lauromoura/webkit/tree/speech-synthesis-glib-stubs This Monday I'll test both together. |
Updated API PR in #854 |
- Add missing functions - Add proper error handling (similar to WebPlatformForEmbedded#823 with optional as in WebPlatformForEmbedded#875) for both UIProcess and WebProcess
- Add missing functions - Add proper error handling (similar to WebPlatformForEmbedded#823 with optional as in WebPlatformForEmbedded#875) for both UIProcess and WebProcess
that doesn't support ErrorEvent yeti (mac)