Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
TipsyTheCat wants to merge 12 commits into jmoenig:master
base: master
Choose a base branch
Loading
from TipsyTheCat:master

Conversation

@TipsyTheCat
Copy link

@TipsyTheCat TipsyTheCat commented Mar 7, 2022

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.

Copy link
Owner

jmoenig commented Mar 7, 2022

Umm, can you tell us what this is about, in particular how it's different from the existing "text to speech" library?

Copy link
Author

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);

Copy link
Owner

jmoenig commented Mar 7, 2022

Hmm... I've just tried the existing library in Chrome 99 and it works just fine...

Copy link
Author

TipsyTheCat commented Mar 7, 2022 via email

On chrome os?
...
On Mon, Mar 7, 2022, 09:20 Jens Mönig ***@***.***> wrote: Hmm... I've just tried the existing library in Chrome 99 and it works just fine... — Reply to this email directly, view it on GitHub <#2999 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AXLNCV6OKUG5VI5PY4LFXB3U6YGEJANCNFSM5QDL4TKQ> . You are receiving this because you authored the thread.Message ID: ***@***.***>

Copy link
Owner

jmoenig commented Mar 7, 2022
edited
Loading

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()?

@TipsyTheCat TipsyTheCat changed the title (削除) Add a working tts library (on chrome browsers) (削除ここまで) (追記) Add a working tts library for Chrome OS (追記ここまで) Mar 10, 2022
Copy link
Author

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()

Copy link
Author

Also, pardon my unclearness...

Copy link
Author

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...

@TipsyTheCat TipsyTheCat marked this pull request as draft April 26, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /