diff --git a/index.bs b/index.bs index e06cdf0..72d0cf3 100644 --- a/index.bs +++ b/index.bs @@ -258,6 +258,8 @@ interface SpeechRecognitionResult { readonly attribute unsigned long length; getter SpeechRecognitionAlternative? item(unsigned long index); readonly attribute boolean isFinal; + readonly attribute double speechStartTime; + readonly attribute double speechEndTime; }; // A collection of responses (used in continuous mode) @@ -382,7 +384,7 @@ See
stop() method
@@ -508,7 +510,7 @@ See
error at [=this=] using {{SpeechRecognitionErrorEvent}} with its {{SpeechRecognitionErrorEvent/error}} attribute initialized to {{SpeechRecognitionErrorCode/not-allowed}} and its {{SpeechRecognitionErrorEvent/message}} attribute set to an implementation-defined string detailing the reason. 1. Abort these steps. +1. Begin consuming audio from the audio source (the {{MediaStreamTrack}} if one was provided, or the microphone otherwise), buffering frames if the recognition service is not yet ready. + This establishes the recognition session's session audio timeline, which measures elapsed audio duration in seconds starting at `0.0` at the first audio frame consumed and advancing with the duration of each subsequent audio frame consumed. 1. Once the system is successfully listening to the recognition, queue a task to [=fire an event=] named start at [=this=]. @@ -666,8 +670,20 @@ For example, some implementations may fire audioe
isFinal attribute
The final boolean must be set to true if this is the final time the speech service will return this particular index value. If the value is false, then this represents an interim result that could still be changed.
+ +
speechStartTime attribute
+
A {{double}} representing the start of the speech segment corresponding to this recognition result, as an offset in seconds on the [=session audio timeline=].
+ +
speechEndTime attribute
+
A {{double}} representing the end of the speech segment corresponding to this recognition result, as an offset in seconds on the [=session audio timeline=].
+

+ {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} are offsets on the [=session audio timeline=], not readings of a system clock. + They are therefore unaffected by audio output latency or by drift between an audio device clock and the system clock, and are identical whether recognition runs in real time or faster than real time. + Their precision is implementation-defined. +

+

SpeechRecognitionResultList

The SpeechRecognitionResultList object holds a sequence of recognition results representing the complete return result of a continuous recognition.