-
Notifications
You must be signed in to change notification settings - Fork 780
Add a working tts library for Chrome OS #2999
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
Added tts
Added tts block xml
Umm, can you tell us what this is about, in particular how it's different from the existing "text to speech" library?
Ever since this, most (if not all) chrome users have been unable to invoke JavaScripts tts api using
var msg = new SpeechSynthesisUtterance();
msg.text = "Hello world";
window.speechSynthesis.speak(msg);
But, by canceling using window.speechSynthesis.cancel() allows speech to properly start.
example:
var msg = new SpeechSynthesisUtterance();
msg.text = "Hello world";
window.speechSynthesis.cancel()
window.speechSynthesis.speak(msg);
Hmm... I've just tried the existing library in Chrome 99 and it works just fine...
no, in Chrome on a Mac and also in Windows.
Okay, I've read up on what you pointed out, and it seems that some user interaction with a page is required before tts will work. But that's literally the case when you click the green flag button to start a project, isn't it? I don't see how calling cancel() would circumvent the autoplay deprecation. Can you tell me more about this? How did you get the idea to call cancel()?
Better naming
Better fitting name
Yet another typo
Fixed accordingly
Personally, I have not idea why it doesn't work or why doing this does work... This is a screen recording of using tts with and without cancel()
Also, pardon my unclearness...
Gee, I make lots of typos -w-
In an attempt to fix my typo, a made ANOTHER typo: fixed (i think)
Ok, so I noticed that on first run of the block it doesn't speak. I'm going to convert this PR into a draft to figure out how to fix this...
Simple JS tts api implementation that actually works on chrome browsers.
Done by using the built-in tts api and adding
window.speechSynthesis.cancel()before speaking the message, which fixes tts not working.