From a0c601b00ea88a9bb109c879fad23d08eba53f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 2 Aug 2019 15:30:41 +1000 Subject: [PATCH] BREAKING CHANGE: Drop grammars grammars are underspecified - they lack a format, so they are kinda useless... so removes grammars attribute, drops SpeechGrammarList, and SpeechGrammar. --- index.bs | 77 +------------------------------------------------------- 1 file changed, 1 insertion(+), 76 deletions(-) diff --git a/index.bs b/index.bs index 51d1b6b..b58f6e0 100644 --- a/index.bs +++ b/index.bs @@ -69,9 +69,7 @@ This subset does not preclude future standardization of additions to the markup, -

Note that for many usages and implementations, it is possible to avoid the need for Rerecognition by using a larger grammar, or by combining multiple grammars — both of these techniques are supported in this specification.

-

Security and privacy considerations

    @@ -148,7 +144,6 @@ The term "interim result" indicates a SpeechRecognitionResult in which the final [Exposed=Window, Constructor] interface SpeechRecognition : EventTarget { // recognition parameters - attribute SpeechGrammarList grammars; attribute DOMString lang; attribute boolean continuous; attribute boolean interimResults; @@ -180,7 +175,6 @@ enum SpeechRecognitionErrorCode { "network", "not-allowed", "service-not-allowed", - "bad-grammar", "language-not-supported" }; @@ -231,31 +225,12 @@ dictionary SpeechRecognitionEventInit : EventInit { required SpeechRecognitionResultList results; }; -// The object representing a speech grammar -[Exposed=Window, Constructor] -interface SpeechGrammar { - attribute DOMString src; - attribute float weight; -}; - -// The object representing a speech grammar collection -[Exposed=Window, Constructor] -interface SpeechGrammarList { - readonly attribute unsigned long length; - getter SpeechGrammar item(unsigned long index); - void addFromURI(DOMString src, - optional float weight); - void addFromString(DOMString string, - optional float weight); -};

    SpeechRecognition Attributes

    -
    grammars attribute
    -
    The grammars attribute stores the collection of SpeechGrammar objects which represent the grammars that are active for this recognition.
    lang attribute
    This attribute will set the language of the recognition for the request, using a valid BCP 47 language tag. [[!BCP47]] @@ -288,7 +263,7 @@ See @@ -395,9 +370,6 @@ For example, some implementations may fire audioe
    "service-not-allowed"
    The user agent is not allowing the web application requested speech service, but would allow some speech service, to be used either because the user agent doesn't support the selected one or because of reasons of security, privacy or user preference.
    -
    "bad-grammar"
    -
    There was an error in the speech recognition grammar or semantic tags, or the grammar format or semantic tag format is unsupported.
    -
    "language-not-supported"
    The language was not supported.
    @@ -478,53 +450,6 @@ For a non-continuous recognition it will hold only a single value.

    Note that when resultIndex equals results.length, no new results are returned, this may occur when the array length decreases to remove one or more interim results. -

    SpeechGrammar

    - -

    The SpeechGrammar object represents a container for a grammar.

    -

    The group has discussed options for which grammar formats should be supported, how builtin grammar types are specified, and default grammars when not specified. -See Default value of SpeechRecognition.grammars thread on public-speech-api@w3.org.

    -

    This structure has the following attributes:

    - -
    -
    src attribute
    -
    The required src attribute is the URI for the grammar. - Note some services may support builtin grammars that can be specified using a builtin URI scheme.
    - -
    weight attribute
    -
    The optional weight attribute controls the weight that the speech recognition service should use with this grammar. - By default, a grammar has a weight of 1. - Larger weight values positively weight the grammar while smaller weight values make the grammar weighted less strongly.
    -
    - -

    SpeechGrammarList

    - -

    The SpeechGrammarList object represents a collection of SpeechGrammar objects. -This structure has the following attributes:

    - -
    -
    length attribute
    -
    The length attribute represents how many grammars are currently in the array.
    - -
    item(index) getter
    -
    The item getter returns a SpeechGrammar from the index into an array of grammars. - The user agent must ensure that the length attribute is set to the number of elements in the array. - The user agent must ensure that the index order from smallest to largest matches the order in which grammars were added to the array.
    - -
    addFromURI(src, weight) method
    -
    This method appends a grammar to the grammars array parameter based on URI. - The URI for the grammar is specified by the src parameter, which represents the URI for the grammar. - Note, some services may support builtin grammars that can be specified by URI. - If the weight parameter is present it represents this grammar's weight relative to the other grammar. - If the weight parameter is not present, the default value of 1.0 is used.
    - -
    addFromString(string, weight) method
    -
    This method appends a grammar to the grammars array parameter based on text. - The content of the grammar is specified by the string parameter. - This content should be encoded into a data: URI when the SpeechGrammar object is created. - If the weight parameter is present it represents this grammar's weight relative to the other grammar. - If the weight parameter is not present, the default value of 1.0 is used.
    -
    -

    The SpeechSynthesis Interface

    The SpeechSynthesis interface is the scripted web API for controlling a text-to-speech output.