Skip to content

Commit 8dd1339

Browse files
Add MediaStreamTrack support to the Web Speech API spec (#118)
Co-authored-by: Evan Liu <[email protected]>
1 parent 8669abc commit 8dd1339

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.bs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ interface SpeechRecognition : EventTarget {
158158

159159
// methods to drive the speech interaction
160160
undefined start();
161+
undefined start(MediaStreamTrack audioTrack);
161162
undefined stop();
162163
undefined abort();
163164

@@ -295,6 +296,9 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
295296
Once the system is successfully listening to the recognition the user agent must raise a start event.
296297
If the start method is called on an already started object (that is, start has previously been called, and no <a event for=SpeechRecognition>error</a> or <a event for=SpeechRecognition>end</a> event has fired on the object), the user agent must throw an "{{InvalidStateError!!exception}}" {{DOMException}} and ignore the call.</dd>
297298

299+
<dt><dfn method for=SpeechRecognition>start({{MediaStreamTrack}} audioTrack)</dfn> method</dt>
300+
<dd>The overloaded start method does the same thing as the parameterless start method except it performs speech recognition on provided {{MediaStreamTrack}} instead of the input media stream. If the {{MediaStreamTrack/kind}} attribute of the {{MediaStreamTrack}} is not "audio" or the {{MediaStreamTrack/readyState}} attribute is not "live", the user agent must throw an "{{InvalidStateError!!exception}}" {{DOMException}} and ignore the call.</dd>
301+
298302
<dt><dfn method for=SpeechRecognition>stop()</dfn> method</dt>
299303
<dd>The stop method represents an instruction to the recognition service to stop listening to more audio, and to try and return a result using just the audio that it has already received for this recognition.
300304
A typical use of the stop method might be for a web application where the end user is doing the end pointing, similar to a walkie-talkie.

0 commit comments

Comments
 (0)