This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30004 - Please add "length" attribute to boundary events
Summary: Please add "length" attribute to boundary events
Status: RESOLVED MOVED
Alias: None
Product: Speech API
Classification: Unclassified
Component: Speech API (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Glen Shires
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-14 20:54 UTC by Jerry Smith
Modified: 2018-08-06 10:46 UTC (History)
3 users (show)

See Also:


Attachments

Description Jerry Smith 2016-11-14 20:54:46 UTC
Please add a length attribute to the boundary events.  Knowing the length in addition to boundary would make it very simple to highlight text while it is being spoken.  Microsoft already supports this in WinRT APIs, and would like to extend this to the web platform in Microsoft Edge.

As discussed on the alias, here's a proposed errata:

Section 5.2 IDL: Add to SpeechSynthesisEvent:

    readonly attribute unsigned long charLength;

Section 5.2.5 SpeechSynthesisEvent Attributes: Add:

charLength attribute

This attribute indicates the length of the text (word or sentence) that will be spoken corresponding to this event. This attribute is the length, in characters, starting from this event's charIndex.  The user agent must return this value if the speech synthesis engine supports it or the user agent can otherwise determine it, otherwise the user agent must return undefined.
Comment 1 Glen Shires 2016-11-16 21:42:46 UTC
Based on discussions on the mailing list [1], there appears to be general agreement with the proposed errata.

If there's no disagreement, I'll add this to the errata page on December 19.

[1] https://lists.w3.org/Archives/Public/public-speech-api/2016Nov/0013.html
Comment 2 Eitan Isaacson 2016-11-23 03:46:27 UTC
I'm not sure how an attribute of type unsigned long can hold a value of "undefined" in certain cases.

But it can be null if it were nullable:
readonly attribute unsigned long? charLength;

Can we change that?
Comment 3 Philip Jägenstedt 2018-08-06 10:46:13 UTC
This change was never applied to the errata, but I've sent https://github.com/w3c/speech-api/pull/30 to make the changes as verbatim as suggested. Please discuss further there.