Skip to content

Commit 9c092a6

Browse files
Remove SpeechGrammar from the Web Speech API spec (#117)
Co-authored-by: Evan Liu <evliu@google.com>
1 parent 43fdc55 commit 9c092a6

1 file changed

Lines changed: 1 addition & 76 deletions

File tree

index.bs

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ This subset does not preclude future standardization of additions to the markup,
7171
<ul>
7272
<li>Voice Web Search</li>
7373
<li>Speech Command Interface</li>
74-
<li>Domain Specific Grammars Contingent on Earlier Inputs</li>
7574
<li>Continuous Recognition of Open Dialog</li>
76-
<li>Domain Specific Grammars Filling Multiple Input Fields</li>
7775
<li>Speech UI present when no visible UI need be present</li>
7876
<li>Voice Activity Detection</li>
7977
<li>Temporal Structure of Synthesis to Provide Visual Feedback</li>
@@ -94,8 +92,6 @@ This does not preclude adding support for this as a future API enhancement, and
9492
<li>Rerecognition</li>
9593
</ul>
9694

97-
<p>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 &mdash; both of these techniques are supported in this specification.</p>
98-
9995
<h2 id=security>Security and privacy considerations</h2>
10096

10197
<ol>
@@ -154,7 +150,6 @@ interface SpeechRecognition : EventTarget {
154150
constructor();
155151

156152
// recognition parameters
157-
attribute SpeechGrammarList grammars;
158153
attribute DOMString lang;
159154
attribute boolean continuous;
160155
attribute boolean interimResults;
@@ -190,7 +185,6 @@ enum SpeechRecognitionErrorCode {
190185
"network",
191186
"not-allowed",
192187
"service-not-allowed",
193-
"bad-grammar",
194188
"language-not-supported"
195189
};
196190

@@ -246,33 +240,12 @@ dictionary SpeechRecognitionEventInit : EventInit {
246240
unsigned long resultIndex = 0;
247241
required SpeechRecognitionResultList results;
248242
};
249-
250-
// The object representing a speech grammar
251-
[Exposed=Window]
252-
interface SpeechGrammar {
253-
attribute DOMString src;
254-
attribute float weight;
255-
};
256-
257-
// The object representing a speech grammar collection
258-
[Exposed=Window]
259-
interface SpeechGrammarList {
260-
constructor();
261-
readonly attribute unsigned long length;
262-
getter SpeechGrammar item(unsigned long index);
263-
undefined addFromURI(DOMString src,
264-
optional float weight = 1.0);
265-
undefined addFromString(DOMString string,
266-
optional float weight = 1.0);
267-
};
268243
</pre>
269244

270245

271246
<h4 id="speechreco-attributes">SpeechRecognition Attributes</h4>
272247

273248
<dl>
274-
<dt><dfn attribute for=SpeechRecognition>grammars</dfn> attribute</dt>
275-
<dd>The grammars attribute stores the collection of SpeechGrammar objects which represent the grammars that are active for this recognition.</dd>
276249

277250
<dt><dfn attribute for=SpeechRecognition>lang</dfn> attribute</dt>
278251
<dd>This attribute will set the language of the recognition for the request, using a valid BCP 47 language tag. [[!BCP47]]
@@ -308,7 +281,7 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
308281
<dl>
309282
<dt><dfn method for=SpeechRecognition>start()</dfn> method</dt>
310283
<dd>When the start method is called it represents the moment in time the web application wishes to begin recognition.
311-
When the speech input is streaming live through the input media stream, then this start call represents the moment in time that the service must begin to listen and try to match the grammars associated with this request.
284+
When the speech input is streaming live through the input media stream, then this start call represents the moment in time that the service must begin to listen.
312285
Once the system is successfully listening to the recognition the user agent must raise a start event.
313286
If the start method is called on an already started object (that is, start has previously been called, and no <a event for=SpeechRecognition>error</a> or <a event for=SpeechRecognition>end</a> event has fired on the object), the user agent must throw an "{{InvalidStateError!!exception}}" {{DOMException}} and ignore the call.</dd>
314287

@@ -427,9 +400,6 @@ For example, some implementations may fire <a event for=SpeechRecognition>audioe
427400
<dt><dfn enum-value for=SpeechRecognitionErrorCode>"service-not-allowed"</dfn></dt>
428401
<dd>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.</dd>
429402

430-
<dt><dfn enum-value for=SpeechRecognitionErrorCode>"bad-grammar"</dfn></dt>
431-
<dd>There was an error in the speech recognition grammar or semantic tags, or the grammar format or semantic tag format is unsupported.</dd>
432-
433403
<dt><dfn enum-value for=SpeechRecognitionErrorCode>"language-not-supported"</dfn></dt>
434404
<dd>The language was not supported.</dd>
435405
</dl>
@@ -510,51 +480,6 @@ For a non-continuous recognition it will hold only a single value.</p>
510480
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.</dd>
511481
</dl>
512482

513-
<h4 id="speechreco-speechgrammar">SpeechGrammar</h4>
514-
515-
<p>The SpeechGrammar object represents a container for a grammar.</p>
516-
<p class=issue>The group has discussed options for which grammar formats should be supported, how builtin grammar types are specified, and default grammars when not specified.
517-
See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Jun/0179.html">Default value of SpeechRecognition.grammars</a> thread on public-speech-api@w3.org.</p>
518-
<p>This structure has the following attributes:</p>
519-
520-
<dl>
521-
<dt><dfn attribute for=SpeechGrammar>src</dfn> attribute</dt>
522-
<dd>The required src attribute is the URI for the grammar.
523-
Note some services may support builtin grammars that can be specified using a builtin URI scheme.</dd>
524-
525-
<dt><dfn attribute for=SpeechGrammar>weight</dfn> attribute</dt>
526-
<dd>The optional weight attribute controls the weight that the speech recognition service should use with this grammar.
527-
By default, a grammar has a weight of 1.
528-
Larger weight values positively weight the grammar while smaller weight values make the grammar weighted less strongly.</dd>
529-
</dl>
530-
531-
<h4 id="speechreco-speechgrammarlist">SpeechGrammarList</h4>
532-
533-
<p>The SpeechGrammarList object represents a collection of SpeechGrammar objects.
534-
This structure has the following attributes:</p>
535-
536-
<dl>
537-
<dt><dfn attribute for=SpeechGrammarList>length</dfn> attribute</dt>
538-
<dd>The length attribute represents how many grammars are currently in the array.</dd>
539-
540-
<dt><dfn method for=SpeechGrammarList>item(<var>index</var>)</dfn> getter</dt>
541-
<dd>The item getter returns a SpeechGrammar from the index into an array of grammars.
542-
The user agent must ensure that the length attribute is set to the number of elements in the array.
543-
The user agent must ensure that the index order from smallest to largest matches the order in which grammars were added to the array.</dd>
544-
545-
<dt><dfn method for=SpeechGrammarList>addFromURI(<var>src</var>, <var>weight</var>)</dfn> method</dt>
546-
<dd>This method appends a grammar to the grammars array parameter based on URI.
547-
The URI for the grammar is specified by the <var>src</var> parameter, which represents the URI for the grammar.
548-
Note, some services may support builtin grammars that can be specified by URI.
549-
The <var>weight</var> parameter represents this grammar's weight relative to the other grammar.
550-
551-
<dt><dfn method for=SpeechGrammarList>addFromString(<var>string</var>, <var>weight</var>)</dfn> method</dt>
552-
<dd>This method appends a grammar to the grammars array parameter based on text.
553-
The content of the grammar is specified by the <var>string</var> parameter.
554-
This content should be encoded into a data: URI when the SpeechGrammar object is created.
555-
The <var>weight</var> parameter represents this grammar's weight relative to the other grammar.
556-
</dl>
557-
558483
<h3 id="tts-section">The SpeechSynthesis Interface</h3>
559484

560485
<p>The SpeechSynthesis interface is the scripted web API for controlling a text-to-speech output.</p>

0 commit comments

Comments
 (0)