If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Dispatch error when nsISpeechService.Speak returns error

RESOLVED FIXED in Firefox 46

Status

()

Core
Web Speech
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

(Blocks: 1 bug)

Trunk
mozilla46
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
+++ This bug was initially created as a clone of Bug #1238522 +++

Related to bug 1238522.  Even if nsISpeechService.Speak() returns any error, there is no way whether current task status is error.

If it is indirect service, we should dispatch error.
(Assignee)

Updated

2 years ago
Summary: Intermittently, the speech synthesis doesn't start after changing the Pitch → Dispatch error when nsISpeechService.Speak returns error
(Assignee)

Comment 1

2 years ago
Created attachment 8708261 [details] [diff] [review]
Dispatch error event when nsISpeechService.Speak returns error
(Assignee)

Comment 2

2 years ago
Created attachment 8708262 [details] [diff] [review]
Change test to return error on Speak method
(Assignee)

Comment 3

2 years ago
Comment on attachment 8708261 [details] [diff] [review]
Dispatch error event when nsISpeechService.Speak returns error

nsISpeechService.Speak can return error.  When returns error without dispatching error event, this task isn't removed from queue.

So I think that we should dispatch error if nsISpeechService.Speak returns error.  Because this is XPCOM and addon developer can implement it.

Also, I have no idea for direct audio yet.
Attachment #8708261 - Flags: review?(eitan)
(Assignee)

Comment 4

2 years ago
Comment on attachment 8708262 [details] [diff] [review]
Change test to return error on Speak method

Change error case on mochitest
Attachment #8708262 - Flags: review?(eitan)
(Assignee)

Updated

2 years ago
Blocks: 1234654
Attachment #8708262 - Flags: review?(eitan) → review+
Comment on attachment 8708261 [details] [diff] [review]
Dispatch error event when nsISpeechService.Speak returns error

Review of attachment 8708261 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ +793,5 @@
> +                                        aPitch, aTask))) {
> +    if (serviceType == nsISpeechService::SERVICETYPE_INDIRECT_AUDIO) {
> +      aTask->DispatchError(0, 0);
> +    }
> +    // XXX When using direct audio, no way to dispatch error

Seems like this should be possible no?
Attachment #8708261 - Flags: review?(eitan) → review+
(Assignee)

Comment 6

2 years ago
(In reply to Eitan Isaacson [:eeejay] from comment #5)
> Comment on attachment 8708261 [details] [diff] [review]
> Dispatch error event when nsISpeechService.Speak returns error
> 
> Review of attachment 8708261 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
> @@ +793,5 @@
> > +                                        aPitch, aTask))) {
> > +    if (serviceType == nsISpeechService::SERVICETYPE_INDIRECT_AUDIO) {
> > +      aTask->DispatchError(0, 0);
> > +    }
> > +    // XXX When using direct audio, no way to dispatch error
> 
> Seems like this should be possible no?

There is no way to dispatch error event from direct service implementation.  nsISpeechTask.sendAudioNative(buffer, 0) or nsISpeechTask.cancel() will dispatch end event, but it isn't error.

Comment 7

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/a86aa13dc19c
https://hg.mozilla.org/integration/mozilla-inbound/rev/9807e39dc5bc

Comment 8

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