Native Messaging => Deno local server => espeak-ng => MediaStreamTrack in browser #17182
guest271314
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use Native Messaging to start and stop a local Deno HTTPS server, POST
espeak-ng
command with input text or SSML (Web Speech API does not support processing SSML input towindow.speechSynthesis.speak()
, or capturing audio output from thespeak()
call), getWAV
back in response, turn off local server, create aMediaStreamTrack
fromespeak-ng
stdout https://github.com/guest271314/native-messaging-espeak-ng/tree/deno-server.We do no install the
deno
executable. We just fetch the executable withwget
to use JavaScript as our local HTTPS server, which we can make requests to from any Web URL we set. We could alternative fetch the zip file and extract it using Web API's andfetch()
.The same source code can be used to start and start your own local HTTPS server to pass arbitrary commands to any local applications and shell scripts, and stream the output back to the browser.
Have fun using SSML input to the
espeak-ng
speech synthesis engine and streaming the audio output as aMediaStreamTrack
locally or to peers using WebRTC. Cheers!Beta Was this translation helpful? Give feedback.
All reactions