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 21772 - Clarify the order of the events
Summary: Clarify the order of the events
Status: RESOLVED FIXED
Alias: None
Product: Speech API
Classification: Unclassified
Component: Speech API (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Glen Shires
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-22 20:31 UTC by Olli Pettay
Modified: 2013-11-06 21:49 UTC (History)
1 user (show)

See Also:


Attachments

Description Olli Pettay 2013-04-22 20:31:38 UTC
Currently it is hard to figure out what is the correct order of various 
events, for example various *start and *end events.
The spec does say that "Unless specified below, the ordering of the different events is undefined" but I think we can do better. 
Especially interesting case is "start" and "end". 
I think those should be the very first and last events, but nothing
in the spec requires or prevents that.
Comment 1 Glen Shires 2013-04-24 01:28:07 UTC
My recollection is that the concern was that some of these events might be detected locally while others detected server-side, thus latency might affect ordering.

However, I agree that we can and should be more specific, to make these events more consistent and useful, particularly for the start and end events.

The error event might be a special case. Perhaps there are conditions where it might fire before start or after end (I'm not sure, let's discuss).

But for the other SpeechRecognition Events, I agree and propose we define that they all occur after start and before end (this includes onresult and nomatch as well as audiostart/end, soundstart/end, speechstart/end.)

Further, because nothing can happen before the user agent has started to capture audio, I propose that:

The audiostart event must always have been fired before soundstart.
The audiostart event must always have been fired before speechstart.
The audiostart event must always have been fired before onresult.
The audiostart event must always have been fired before nomatch.

I'm hesitant to define other relationships. For example, although soundstart is by definition low-latency, if it is detected in the client and speechstart is detected in the server, it's still possible that the server might trigger speechstart first if its detection threshold is more sensitive than the client's. Similarly for onresult and nomatch.  However, if there are some good reasons or use cases to define these further, let's discuss.
Comment 2 Glen Shires 2013-10-23 20:42:05 UTC
I propose the following errata.
If there's no disagreement, I'll add this to the errata page on November 6.

Section 5.1.3: soundstart event: append at the end of the definition:
  The audiostart event must always have been fired before the soundstart event.

Section 5.1.3: speechstart event: append at the end of the definition:
  The audiostart event must always have been fired before the speechstart event.

Section 5.1.3: onresult event: append at the end of the definition:
  The audiostart event must always have been fired before the onresult event.

Section 5.1.3: nomatch event: append at the end of the definition:
  The audiostart event must always have been fired before the nomatch event.

Section 5.1.3: speechend event: replace the word "fire" with "fired".
Comment 3 Glen Shires 2013-11-06 21:49:20 UTC
I've updated the errata with the above change (E15):
https://dvcs.w3.org/hg/speech-api/rev/c4b3451ce85c

As always, the current errata is at:
http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi-errata.html