diff --git a/index.bs b/index.bs index e62c62c..bb21b10 100644 --- a/index.bs +++ b/index.bs @@ -118,6 +118,8 @@ This does not preclude adding support for this as a future API enhancement, and
  • 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.
  • + +
  • 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.
  • Implementation considerations

    @@ -155,12 +157,15 @@ interface SpeechRecognition : EventTarget { attribute boolean continuous; attribute boolean interimResults; attribute unsigned long maxAlternatives; + attribute SpeechRecognitionMode mode; // methods to drive the speech interaction undefined start(); undefined start(MediaStreamTrack audioTrack); undefined stop(); undefined abort(); + boolean onDeviceWebSpeechAvailable(DOMString lang); + boolean installOnDeviceSpeechRecognition(DOMString lang); // event methods attribute EventHandler onaudiostart; @@ -187,6 +192,12 @@ enum SpeechRecognitionErrorCode { "language-not-supported" }; +enum SpeechRecognitionMode { + "ondevice-preferred", // On-device speech recognition if available, otherwise use Cloud speech recognition as a fallback. + "ondevice-only", // On-device speech recognition only. Returns an error if on-device speech recognition is not available. + "cloud-only", // Cloud speech recognition only. +}; + [Exposed=Window] interface SpeechRecognitionErrorEvent : Event { constructor(DOMString type, SpeechRecognitionErrorEventInit eventInitDict); @@ -282,6 +293,9 @@ interface SpeechGrammarList {
    maxAlternatives attribute
    This attribute will set the maximum number of {{SpeechRecognitionAlternative}}s per result. The default value is 1.
    + +
    mode attribute
    +
    An enum to determine where speech recognition takes place. The default value is "ondevice-preferred".

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. @@ -312,6 +326,13 @@ See SpeechRecognition Events