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

[Question] Speech Synthesis onend method not called sometimes #16

Open
RichardsonWTR opened this issue Jul 4, 2016 · 1 comment
Open

Comments

@RichardsonWTR
Copy link

Hi!

At least, in Chrome the speech synthesis not call the onend method sometimes. I'm using Chrome 49.0.2623.87. I have faced this problem reproducing big messages.
See in Chromium Bugs.

I have found some workarounds, but nothing worked.

My workaround on this was to set a maximum time of audio reproduction, then I cancel the audios on queue.

window.speechSynthesis.speak(msg);
audio_timeout = setTimeout(function(){
    window.speechSynthesis.cancel();
},20000);

// And and when the onend method not fails, the timeout is cancelled
msg.onend = function(e) {
   clearTimeout(audio_timeout);
};

My question is: in this polyfill, do you have a workaround about it?
Cheers!

@RichardsonWTR RichardsonWTR changed the title Speech Synthesis onend method not called sometimes [Question] Speech Synthesis onend method not called sometimes Jul 4, 2016
@janantala
Copy link
Owner

Hi @RichardsonWilliam

I have no idea, however onend is called when audio is stopped. So it could work. Feel free to try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants