Closed Bug 1239946 Opened 8 years ago Closed 8 years ago

Dispatch error when nsISpeechService.Speak returns error

Categories

(Core :: Web Speech, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(2 files)

+++ 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.
Summary: Intermittently, the speech synthesis doesn't start after changing the Pitch → Dispatch error when nsISpeechService.Speak returns error
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)
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)
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+
(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.
https://hg.mozilla.org/mozilla-central/rev/a86aa13dc19c
https://hg.mozilla.org/mozilla-central/rev/9807e39dc5bc
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: