Skip to content

Consider redesigning the Web Speech API with Promises & ReadableStreams #130

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

Open
evanbliu opened this issue Jan 9, 2025 · 1 comment
Open

Comments

@evanbliu
Copy link
Collaborator

evanbliu commented Jan 9, 2025

The Web Speech API's reliance on events and callbacks hinders its usability in modern web development. Adopting Promises would streamline asynchronous operations like speech recognition and synthesis, improving code readability and error handling. Modernizing the API with Promises and ReadableStreams aligns it with current web standards, promotes cleaner code, and unlocks new potential for web-based speech applications.

While the existing Web Speech API functionality will remain to maintain backwards compatibility, we should consider if the pros/cons warrant the development of a new, modernized version of the Web Speech API.

https://www.w3.org/TR/design-principles/#promises
https://www.w3.org/2001/tag/doc/promises-guide

@bkardell
Copy link

bkardell commented Apr 2, 2025

Yes, please - I have been asking for this since 2017. I would love to maybe be involved in this... Back then I wrote several pieces on this and had sketched a kind of a shape for Speech To Text in https://bkardell.com/blog/Voice-Recognition-Thoughts.html, and Text to Speech in https://bkardell.com/blog/Basic-Voice-Speaker.html ... I haven't looked at them in some time to see if I still agree with all of my observations but I'd definitely still be interested in addressing some of these. I recently saw that .start(MediaStreamTrack) shipped in chrome... it seemed like it might have some of those issues I remembered so ran over to try throwing an mp3 at it only to be sad that it didn't seem to transcribe more than the first few seconds..

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

No branches or pull requests

2 participants