New issue
Advanced search Search tips

Issue 509488 link

Starred by 8 users

Issue metadata

Status: Untriaged
Owner: ----
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Sign in to add a comment

Web Speech API: 'end' event of SpeechSynthesisUtterance object is not dispatched sometimes

Reported by, Jul 13 2015

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36

Steps to reproduce the problem:
<!-- test.html -->
<!DOCTYPE html>
  <meta charset="utf-8" />
  <title>Web Speech API onend event test</title>
    var speechTexts = ['こんにちは', 'おはようございます'];
    (function speech(text) {
      if (text) {
        var synthes = new SpeechSynthesisUtterance();
        synthes.voiceURI = 'Google 日本語';
        synthes.volume = 1; // 0~1   
        synthes.rate = 1;   // 0.1~10
        synthes.pitch = 1;  // 0~2
        synthes.text = text;
        synthes.lang = 'ja-JP';
        synthes.onend = function () {
          var text = speechTexts.shift();

What is the expected behavior?

What went wrong?

Did this work before? N/A 

Chrome version: 43.0.2357.132  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 18.0 r0

Comment 1 by, Jul 13 2015

Labels: -Cr-Blink-JavaScript Cr-Blink-Speech
Summary: Web Speech API: 'end' event of SpeechSynthesisUtterance object is not dispatched sometimes (was: Web Speech API SpeechSynthesisUtteranceオブジェクトのonendイベントが発生しない時がある。)
What is the expected behavior?
 Speak "こんにちは", then "おはようございます".

What went wrong?
If we repeatedly reload the page, "onend" handler of the SpeechSynthesisUtterance object for "こんにちは" is not called once per 10 times, and "おはようございます" is not spoken.

Labels: Needs-Feedback
[triage] what feedback is needed here?
Labels: -Needs-Feedback
Status: Assigned
I'm clearing the feedback label since it looks like the original report has the full source for a repro. Sending to dmazzoni@ since this appears to be related to speech synthesis.

Comment 5 by, Sep 12 2015

Any ETA on when this might be fixed?
Labels: Hotlist-Recharge
This issue likely requires triage.  The current issue owner maybe inactive (i.e. hasn't fixed an issue in the last 30 days).  Thanks for helping out!

Status: Available
Owner: ----
I confirm this issue is still present in Chrome 47.0.2526.106.
I also believe I am seeing this issue.  I followed a stackoverflow suggestion and wrapped the call to window.speechSynthesis.speak() in a setTimeout and that seems to guarantee the onend callback.  This seems to imply a timing issue.
I found that if SpeechSynthesisUtterance instance will be stored in other scope (for example in global variable) onend event will work.

Please see examples:
1) end event does not work -
2) end event workaround with global storing -

It seems like garbage collector removes utterance object before end-event is fired.
Project Member

Comment 12 by, Jan 20 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue.
The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue.

For more details visit - Your friendly Sheriffbot
I had this problem in Chrome 70, then upgraded to 71 and I wasn't able to reproduce it again. It might have been fixed. I can't really confirm though.

Sign in to add a comment