Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor spec updates #132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ This does not preclude adding support for this as a future API enhancement, and

<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>

<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>
<li>To reduce the risk of fingerprinting, 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>
</ol>

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

<pre class="idl">
<xmp class="idl">
[Exposed=Window]
interface SpeechRecognition : EventTarget {
constructor();
Expand All @@ -165,8 +165,8 @@ interface SpeechRecognition : EventTarget {
undefined start(MediaStreamTrack audioTrack);
undefined stop();
undefined abort();
boolean onDeviceWebSpeechAvailable(DOMString lang);
boolean installOnDeviceSpeechRecognition(DOMString lang);
Promise<boolean> onDeviceWebSpeechAvailable(DOMString lang);
Promise<boolean> installOnDeviceSpeechRecognition(DOMString lang);

// event methods
attribute EventHandler onaudiostart;
Expand Down Expand Up @@ -264,7 +264,7 @@ interface SpeechGrammarList {
undefined addFromString(DOMString string,
optional float weight = 1.0);
};
</pre>
</xmp>


<h4 id="speechreco-attributes">SpeechRecognition Attributes</h4>
Expand Down Expand Up @@ -329,10 +329,10 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
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>

<dt><dfn method for=SpeechRecognition>onDeviceWebSpeechAvailable({{DOMString}} lang)</dfn> method</dt>
<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>
<dd>The onDeviceWebSpeechAvailable 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]] The method returns true if on-device speech recognition is available for the given BCP 47 language tag and false otherwise.</dd>

<dt><dfn method for=SpeechRecognition>installOnDeviceSpeechRecognition({{DOMString}} lang)</dfn> method</dt>
<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>
<dd>The installOnDeviceSpeechRecognition 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]] 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>

</dl>

Expand Down Expand Up @@ -406,7 +406,7 @@ For example, some implementations may fire <a event for=SpeechRecognition>audioe
<dd>The errorCode is an enumeration indicating what has gone wrong.
The values are:
<dl>
<dt><dfn enum-value for=SpeechRecognitionErrorCode>"no-speech"</code></dt>
<dt><dfn enum-value for=SpeechRecognitionErrorCode>"no-speech"</dfn></dt>
<dd>No speech was detected.</dd>

<dt><dfn enum-value for=SpeechRecognitionErrorCode>"aborted"</dfn></dt>
Expand Down