Skip to content
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

EasySpeech.speak stop currently playing speech #269

Open
ivoryguard opened this issue Apr 16, 2024 · 3 comments
Open

EasySpeech.speak stop currently playing speech #269

ivoryguard opened this issue Apr 16, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@ivoryguard
Copy link
Contributor

Hello.

The speak method of the W3C SpeechSynthesis API is responsible for queuing a SpeechSynthesisUtterance for text-to-speech (TTS). Therefore, window.speechSynthesis.speak(utterance) allows new text to be played without interrupting the currently playing speech.

However, when the EasySpeech.speak method is called, the current speech stops and the new text is played.

It seems that EasySpeech.speak should operate in a way similar to window.speechSynthesis.speak, adding the new SpeechSynthesisUtterance to the queue without interrupting the currently playing speech.

Or, is there a way for EasySpeech.speak to not interrupt the currently playing speech?

@jankapunkt
Copy link
Member

Hi @ivoryguard and thank you for pointing this out. Currently this is hard-coded into EasySpeech. However, it should be easy (haha) to add another flag noStop to the speech method that, if truthy, will circumvent calling the stop method. What do you think? Mind to create a PR for this?

@jankapunkt jankapunkt added enhancement New feature or request good first issue Good for newcomers labels Apr 16, 2024
@ivoryguard
Copy link
Contributor Author

I did it.

@jankapunkt
Copy link
Member

jankapunkt commented Apr 25, 2024

Please try [email protected] and let me know if things work as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants