The window.speechSynthesis.pause() makes the SpeechSynthesis.speaking equal true until browser restart and stop working if it is pressed at the tail end of the speaking text.

RESOLVED FIXED in Firefox 49

Status

()

Core
Web Speech
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Brandon, Assigned: m_kato)

Tracking

45 Branch
mozilla49
x86_64
Windows 10
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160315153207

Steps to reproduce:

Queue a text object to speak using the window.speechSynthesis.speak() function.
Next, setup a button to pause or resume speech when pressed.
First notice that there is a delay when the speech is run and the pause button is pressed. It can be a considerable delay, sometimes lasting almost up to a second.
Next press the pause button right before the speech ends. It should sound like it paused right as the text ended, even though you pressed space while the speech was still talking.


Actual results:

When you go to play the speech again, nothing happens. Even if you close and reopen the page the speech does not play. In order to get the speech to play again the whole web browser needs to be restarted.



Expected results:

First, speech should pause instantly, not waiting for any delay.
Second, I should be able to pause and resume even while no speech is queued.
Third, the speech should always work, even after it has been paused and resumed after it has finished.
(Reporter)

Updated

2 years ago
Summary: The window.speechSynthesis.pause() makes the speech stop working on the page if it is pressed at the tail end of the speaking text. → The window.speechSynthesis.pause() makes the SpeechSynthesis.speaking equal true until browser restart and stop working if it is pressed at the tail end of the speaking text.
(Reporter)

Comment 1

2 years ago
I just noticed that what is happening is SpeechSynthesis.speaking is always true after the pause is pressed at the tail-end of the text. There appears to be no way of making it false. Even when pause is false, the speech does not continue.

Updated

2 years ago
Component: Untriaged → Web Speech
Product: Firefox → Core
(Assignee)

Comment 2

2 years ago
Brandon, could you test same test on the Nightly (48.0), too?   45.0 is not stable as Web Speech implementation (So we don't turn on it as default).
Flags: needinfo?(brandonkeithbiggs)
(Reporter)

Comment 3

2 years ago
Is it possible to install the future build along side the non future build? Here is the html just in case you would like to try it. Just save it as an html file... Then pause the speech just before it ends. Press space to pause, f to read the state of the different flags on window.speechSynthesis.


<!DOCTYPE html>
<head>
<title>onboundary bug</title>
</head>
<body>
<button id="b1">Click me to talk</button>

<script>
var synth = window.speechSynthesis;

var press_function = function(e){
	if(e.key == " "){
		console.log("paused");
		synth.pause()};
	if(e.key == "f"){
		console.log("paused: " + synth.paused + "\npending: " + synth.pending + "\nspeaking: " + synth.speaking);
}

	};

var spk = function(){
	var u = new SpeechSynthesisUtterance("Hello people, I like cheese. I will win, I will eat food.");
	u.onboundary = function(event){console.log(event.name + ' boundary reached after ' + event.elapsedTime + ' milliseconds.');};
	synth.speak(u);
	};

b1.onclick = spk;
b1.onkeydown = press_function;

</script>
</body>
</html>
Flags: needinfo?(brandonkeithbiggs)
(Reporter)

Comment 4

2 years ago
OK, I installed Nightly and yes, it still is the same.
I found another bug though that drove me in sain:
When I installed nightly, even though my old firefox was enabled with speech, both browsers gave me an error that SpeechSynthesisUtterance was not defined. In order to fix this, I had to go into about:config and uncheck and recheck speech.
(Assignee)

Updated

2 years ago
OS: Unspecified → Windows
(Reporter)

Updated

2 years ago
OS: Windows → Windows 10
Hardware: Unspecified → x86_64
(Assignee)

Updated

2 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 5

2 years ago
OK.  I make sense this.

Even if SAPI calls cancel, paused state on current SAPI instance isn't clear.  So, new speech instance doesn't start until resume is called.

So I think that we should create instance after cancel.
(Assignee)

Updated

2 years ago
Assignee: nobody → m_kato
Blocks: 1268633
(Assignee)

Comment 6

2 years ago
Created attachment 8749571 [details]
MozReview Request: Bug 1258526 - Create SAPI object per speech to clear previous speech state at force. r?eeejay

When using the following script, stop method cannot clear pause state on SAPI backend.

speech.pause();
speech.stop();

Since SPF_PURGEBEFORESPEAK doesn't clear previous speech state, we should create SAPI object per speech instead of recycling it.

Review commit: https://reviewboard.mozilla.org/r/51041/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/51041/
Attachment #8749571 - Flags: review?(eitan)
I'm going to get to this next week, sorry for the delay.
Comment on attachment 8749571 [details]
MozReview Request: Bug 1258526 - Create SAPI object per speech to clear previous speech state at force. r?eeejay

https://reviewboard.mozilla.org/r/51041/#review48205

This looks good.
Attachment #8749571 - Flags: review?(eitan) → review+

Comment 9

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d6c7ebc1417b

Comment 10

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d6c7ebc1417b
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.