The default bug view has changed. See this FAQ.

Speech dispatcher rate conversion is wildly inaccurate

VERIFIED FIXED in Firefox 48

Status

()

Core
Web Speech
VERIFIED FIXED
a year ago
9 months ago

People

(Reporter: eeejay, Assigned: eeejay)

Tracking

unspecified
mozilla48
Unspecified
Linux
Points:
---

Firefox Tracking Flags

(firefox48 verified)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

a year ago
With some experimentation, it seems that the rate values given to speechd bring very inaccurate results. From looking at how Chromium converts the rate values, it is apparent that the min/max speeds in speechd are 3x.

Some normalization needs to happen to make this consistent with other platforms browsers.
(Assignee)

Comment 1

a year ago
Created attachment 8728133 [details]
MozReview Request: Bug 1254738 - Fix utterance rate conversion for speech dispatcher. r?smaug

Review commit: https://reviewboard.mozilla.org/r/38809/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/38809/
Attachment #8728133 - Flags: review?(bugs)
(Assignee)

Updated

a year ago
Blocks: 1254234
Could you explain the log10 usage here a bit?
Flags: needinfo?(eitan)
Attachment #8728133 - Flags: review?(bugs) → review+
Comment on attachment 8728133 [details]
MozReview Request: Bug 1254738 - Fix utterance rate conversion for speech dispatcher. r?smaug

https://reviewboard.mozilla.org/r/38809/#review36183

::: dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
(Diff revision 1)
> -  // speech-dispatcher expects -100 to 100 with 0 being default.
> -  int rate = 0;
> +  // The rate range in speechd is roughly x3 at both ends (0.334 .. 3).
> +  int rate = std::max<float>(std::min<float>(aRate, 3), 0.334);
>  
> -  if (aRate > 1) {
> -    rate = static_cast<int>((aRate - 1) * 10);
> +  // speech-dispatcher expects -100 to 100 with 0 being default.
> +  spd_set_voice_rate(mSpeechdClient, log10(rate) / log10(3) * 100);
> -  } else if (aRate <= 1) {

So could you at least change the comment about "-100 to 100" a bit explaining what the limits are and that we end up passing from -43 to 43
(Assignee)

Comment 4

a year ago
Sorry for not being responsive. I took that math from Chromium. That is how they translate rate values. It gives more correct rate scaling, but I think we could do better, specifically at rates that are smaller than 1x.

I made a little tool that can be used to compare speech rates across platforms/voices/browsers. I want to have as much consistency as possible, even though I know getting it fully accurate is impossible.

I'll come up with another translation and flag you for review soon.
Flags: needinfo?(eitan)
(Assignee)

Comment 5

a year ago
I'm lost with the new mozreview way of doing things.. not sure how to obsolete the patch correctly. I'll upload another one soon.
I'm more than happy to review in bugzilla the old way ;)
But up to you. If you prefer MozReview, use that.
(Assignee)

Updated

a year ago
Attachment #8728133 - Attachment is obsolete: true
(Assignee)

Comment 7

a year ago
Here is the rate distribution we have right now:

http://eeejay.github.io/webspeechdemos/rates.html?%5B%22urn%3Amoz-tts%3Asapi%3Adefault%3Fen%22%2C%22default%22%2C%220.658995397238343%22%2C%220.684900166389351%22%2C%220.7124621376027693%22%2C%220.7570114942528736%22%2C%220.8044460730426286%22%2C%220.884739387426115%22%2C%221%22%2C%221.004882514494965%22%2C%221.0605475040257648%22%2C%221.082689462436298%22%2C%221.132198727866598%22%2C%221.1507950375677092%22%2C%221.1976723040552828%22%5D
(Assignee)

Comment 8

a year ago
Created attachment 8730910 [details] [diff] [review]
Normalize speech rate for speech dispatcher.

These adjustments actually make the speech rate better across all voices.
Attachment #8730910 - Flags: review?(bugs)
(Assignee)

Comment 9

a year ago
http://eeejay.github.io/webspeechdemos/rates.html?%5B%22urn%3Amoz-tts%3Aspeechd%3Adefault%3Fen%22%2C%22default%22%2C%220.5008373934226553%22%2C%220.500494484594903%22%2C%220.5006849315068493%22%2C%220.5779163738580464%22%2C%220.6965590259396506%22%2C%220.8342632513314735%22%2C%221%22%2C%221.3224120603015075%22%2C%221.5582662245381336%22%2C%221.8074175824175824%22%2C%222.001521143900213%22%2C%222.2032819825853984%22%2C%222.4457249070631972%22%5D
(Assignee)

Comment 10

a year ago
^ that is after the applied patch
Comment on attachment 8730910 [details] [diff] [review]
Normalize speech rate for speech dispatcher.

>+  // We provide a rate of 0.1 to 10 with 1 being default.
I don't understand what this means now. Please fix the comment
Attachment #8730910 - Flags: review?(bugs) → review+
(Assignee)

Comment 12

a year ago
Created attachment 8731333 [details] [diff] [review]
Normalize speech rate for speech dispatcher. r=smaug

MozReview-Commit-ID: 79OuII34vz7
Attachment #8730910 - Attachment is obsolete: true
(Assignee)

Updated

a year ago
Assignee: nobody → eitan

Comment 13

a year ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f7597cb7ff9b

Comment 14

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f7597cb7ff9b
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Verified fixed on Firefox 48 Beta 2, buildID: 20160620091522 (with "media.webspeech.synth.enabled" set to true), using this tool: http://eeejay.github.io/webspeechdemos/rates.html.
Status: RESOLVED → VERIFIED
status-firefox48: fixed → verified
You need to log in before you can comment on or make changes to this bug.