Skip to content

Commit 59f74d4

Browse files
Minor spec updates (#132)
* Minor spec updates * Minor spec updates * Minor spec updates * Minor spec updates * Minor spec updates * Update index.bs * Update index.bs --------- Co-authored-by: Evan Liu <evliu@google.com>
1 parent 9c092a6 commit 59f74d4

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

index.bs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ This does not preclude adding support for this as a future API enhancement, and
116116
</li>
117117

118118
<li>The user agent may also give the user a longer explanation the first time speech input is used, to let the user know what it is and how they can tune their privacy settings to disable speech recording if required.</li>
119-
120-
<li>User agents must obtain explicit and informed user consent before installing on-device speech recognition languages that differ from the user's preferred language or when the user is not connected to an Ethernet or Wi-Fi network.</li>
121119
</ol>
122120

123121
<h3 id="implementation-considerations">Implementation considerations</h3>
@@ -144,7 +142,7 @@ This does not preclude adding support for this as a future API enhancement, and
144142
The term "final result" indicates a SpeechRecognitionResult in which the final attribute is true.
145143
The term "interim result" indicates a SpeechRecognitionResult in which the final attribute is false.
146144

147-
<pre class="idl">
145+
<xmp class="idl">
148146
[Exposed=Window]
149147
interface SpeechRecognition : EventTarget {
150148
constructor();
@@ -161,8 +159,8 @@ interface SpeechRecognition : EventTarget {
161159
undefined start(MediaStreamTrack audioTrack);
162160
undefined stop();
163161
undefined abort();
164-
boolean onDeviceWebSpeechAvailable(DOMString lang);
165-
boolean installOnDeviceSpeechRecognition(DOMString lang);
162+
static Promise<boolean> availableOnDevice(DOMString lang);
163+
static Promise<boolean> installOnDevice(DOMString lang);
166164

167165
// event methods
168166
attribute EventHandler onaudiostart;
@@ -240,8 +238,7 @@ dictionary SpeechRecognitionEventInit : EventInit {
240238
unsigned long resultIndex = 0;
241239
required SpeechRecognitionResultList results;
242240
};
243-
</pre>
244-
241+
</xmp>
245242

246243
<h4 id="speechreco-attributes">SpeechRecognition Attributes</h4>
247244

@@ -304,11 +301,11 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
304301
The user agent must raise an <a event for=SpeechRecognition>end</a> event once the speech service is no longer connected.
305302
If the abort method is called on an object which is already stopped or aborting (that is, start was never called on it, the <a event for=SpeechRecognition>end</a> or <a event for=SpeechRecognition>error</a> event has fired on it, or abort was previously called on it), the user agent must ignore the call.</dd>
306303

307-
<dt><dfn method for=SpeechRecognition>onDeviceWebSpeechAvailable({{DOMString}} lang)</dfn> method</dt>
308-
<dd>The onDeviceWebSpeechAvailable method returns a boolean indicating whether on-device speech recognition is available for a given BCP 47 language tag. [[!BCP47]] The method returns true if on-device speech recognition is available for the given BCP 47 language tag and false otherwise.</dd>
304+
<dt><dfn method for=SpeechRecognition>availableOnDevice({{DOMString}} lang)</dfn> method</dt>
305+
<dd>The availableOnDevice method returns a Promise that resolves to a boolean indicating whether on-device speech recognition is available for a given BCP 47 language tag. [[!BCP47]]</dd>
309306

310-
<dt><dfn method for=SpeechRecognition>installOnDeviceSpeechRecognition({{DOMString}} lang)</dfn> method</dt>
311-
<dd>The installOnDeviceSpeechRecognition method returns a boolean indicating whether the installation of on-device speech recognition for a given BCP 47 language tag initiated successfully. [[!BCP47]] Any website can automatically trigger a download of a new language pack if the user is connected to ethernet/Wifi and the language pack matches the user's preferred language. All sites must prompt the user if they wish to trigger a download over a cellular network or a language pack that does not match the user's preferred language.</dd>
307+
<dt><dfn method for=SpeechRecognition>installOnDevice({{DOMString}} lang)</dfn> method</dt>
308+
<dd>The installOnDevice method returns a Promise that resolves to a boolean indicating whether the installation of on-device speech recognition for a given BCP 47 language tag initiated successfully. [[!BCP47]]</dd>
312309

313310
</dl>
314311

0 commit comments

Comments
 (0)