You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dd>This attribute will set the language of the recognition for the request, using a valid BCP 47 language tag. [[!BCP47]]
258
-
If unset it remains unset for getting in script, but will default to use the <a spec=html>language</a> of the html document root element and associated hierarchy.
265
+
If unset it remains unset for getting in script, but will default to use the language of the html document root element and associated hierarchy.
259
266
This default value is computed and used when the input request opens a connection to the recognition service.</dd>
@@ -323,12 +330,47 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
323
330
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>
<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>
333
+
<dd>
334
+
The {{SpeechRecognition/availableOnDevice}} method returns a {{Promise}} that resolves to a {{AvailabilityStatus}} indicating the on-device speech recognition availability for a given [[!BCP47]] language tag.
335
+
336
+
When invoked, run these steps:
337
+
1. Let <var>promise</var> be <a>a new promise</a>.
338
+
1. Run the <a>on-device availability algorithm</a> with <var>lang</var> and <var>promise</var>. If it returns an exception, throw it and abort these steps.
<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>
343
+
<dd>
344
+
The {{SpeechRecognition/installOnDevice}} method returns a {{Promise}} that resolves to a {{boolean}} when and whether the installation of on-device speech recognition for a given [[!BCP47]] language tag succeeded.
345
+
346
+
When invoked, run these steps:
347
+
1. If the [=current settings object=]'s [=relevant global object=]'s [=associated Document=] is NOT [=fully active=], throw an {{InvalidStateError}} and abort these steps.
348
+
1. If <var>lang</var> is not a valid [[!BCP47]] language tag, throw a {{SyntaxError}} and abort these steps.
349
+
1. If the on-device speech recognition language pack for <var>lang</var> is unsupported, return a resolved {{Promise}} with false and skip the rest of these steps.
350
+
1. Let <var>promise</var> be <a>a new promise</a>.
351
+
1. Initiate the download of the on-device speech recognition language for <var>lang</var>.
352
+
<p class=note>
353
+
Note: The user agent can prompt the user for explicit permission to download the on-device speech recognition language pack.
354
+
</p>
355
+
1. [=Queue a task=] on the [=relevant global object=]'s [=task queue=] to run the following step:
356
+
- If the download succeeds, resolve <var>promise</var> with <code>true</code>, otherwise resolve it with <code>false</code>.
357
+
<p class="note">
358
+
Note: The <code>false</code> resolution of the Promise does not indicate the specific cause of failure. User agents are encouraged to provide more detailed information about the failure in developer tools console messages. However, this detailed error information is not exposed to the script.
359
+
</p>
360
+
1. Return <var>promise</var>.
361
+
</dd>
330
362
331
363
</dl>
364
+
<p>When the <dfn>on-device availability algorithm</dfn> with <var>lang</var> and <var>promise</var> is invoked, the user agent MUST run the following steps:
365
+
1. If the [=current settings object=]'s [=relevant global object=]'s [=associated Document=] is NOT [=fully active=], throw an {{InvalidStateError}} and abort these steps.
366
+
1. If <var>lang</var> is not a valid [[!BCP47]] language tag, throw a {{SyntaxError}} and abort these steps.
367
+
1. Determine the availability status for <var>lang</var>:
368
+
- If the on-device speech recognition language pack for <var>lang</var> is unsupported, let <var>status</var> be {{AvailabilityStatus/unavailable}}.
369
+
- Else if the on-device speech recognition language pack for <var>lang</var> is supported but not installed, let <var>status</var> be {{AvailabilityStatus/downloadable}}.
370
+
- Else if the on-device speech recognition language pack for <var>lang</var> is downloading, let <var>status</var> be {{AvailabilityStatus/downloading}}.
371
+
- Else if the on-device speech recognition language pack for <var>lang</var> is installed, let <var>status</var> be {{AvailabilityStatus/available}}.
372
+
1. [=Queue a task=] on the [=relevant global object=]'s [=task queue=] to run the following step:
373
+
- Resolve <var>promise</var> with <var>status</var>.
332
374
333
375
When the <dfn>start session algorithm</dfn> with
334
376
|requestMicrophonePermission| is invoked, the user agent MUST run the
<dd>This attribute specifies the language of the speech synthesis for the utterance, using a valid BCP 47 language tag. [[!BCP47]]
688
-
If unset it remains unset for getting in script, but will default to use the <a spec=html>language</a> of the html document root element and associated hierarchy.
730
+
If unset it remains unset for getting in script, but will default to use the language of the html document root element and associated hierarchy.
689
731
This default value is computed and used when the input request opens a connection to the recognition service.</dd>
0 commit comments