-
Notifications
You must be signed in to change notification settings - Fork 661
feat(text-to-speech): add support for using synthesize
#807
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
Conversation
|
How can you see when the websocket was closed? can we have an |
synthesizesynthesize - WIP
|
There is a self.emit('close', event.code, event.reason);I just didn't include it in the demo. |
Codecov Report
@@ Coverage Diff @@
## master #807 +/- ##
=======================================
Coverage 95.65% 95.65%
=======================================
Files 2 2
Lines 46 46
Branches 2 2
=======================================
Hits 44 44
Misses 2 2Continue to review full report at Codecov.
|
synthesize - WIPsynthesize
|
@germanattanasio documentation, example, and test added |
| // the 'code' parameter is the status code. 1000 is the code for a normal termination | ||
| // the 'reason' parameter provides a string description of how the connection closed | ||
| synthesizeStream.on('close', (code, reason) => { | ||
| console.log(code); |
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.
Nice 🎉
|
When running in node we use the The questions are not related to this PR which is good |
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.
👍 Good job @dpopp07
Adds a new method -
synthesizeUsingWebSocket- that returns aReadableStreamthat the user can pipe into a new file or over the speakers. Returning a stream seemed to be the best user experience since the point of websocket is to allow the user to receive data in chunks in real time without reading all data into memory at once.I tried to keep the design similar to
recognizeUsingWebSocketfor a consistent experience, but did not adopt any code that seemed unnecessary.There might be more features that are needed but this provides the basic needs of the user with simple code and a simple interface.
I still need to write tests and an example but wanted to start getting feedback on the implementation.
cc @ehdsouza @jsstylos @jeffpk62
Todo:
This is what the experience looks like for the user: