File: SpeechRecognition.hx

package info (click to toggle)
haxe 1%3A4.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 42,984 kB
  • sloc: ml: 132,401; ansic: 2,403; makefile: 436; java: 365; cs: 336; cpp: 318; python: 315; sh: 75; objc: 64; php: 45; xml: 30; javascript: 11
file content (140 lines) | stat: -rw-r--r-- 5,480 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
 * Copyright (C)2005-2019 Haxe Foundation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

// This file is generated from mozilla\SpeechRecognition.webidl. Do not edit!

package js.html;

/**
	The `SpeechRecognition` interface of the Web Speech API is the controller interface for the recognition service; this also handles the `SpeechRecognitionEvent` sent from the recognition service.

	Documentation [SpeechRecognition](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).

	@see <https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition>
**/
@:native("SpeechRecognition")
extern class SpeechRecognition extends EventTarget {
	
	/**
		Returns and sets a collection of `SpeechGrammar` objects that represent the grammars that will be understood by the current `SpeechRecognition`.
	**/
	var grammars : SpeechGrammarList;
	
	/**
		Returns and sets the language of the current `SpeechRecognition`. If not specified, this defaults to the HTML `lang` attribute value, or the user agent's language setting if that isn't set either.
	**/
	var lang : String;
	
	/**
		Controls whether continuous results are returned for each recognition, or only a single result. Defaults to single (`false`.)
	**/
	var continuous : Bool;
	
	/**
		Controls whether interim results should be returned (`true`) or not (`false`.) Interim results are results that are not yet final (e.g. the `SpeechRecognitionResult.isFinal` property is `false`.)
	**/
	var interimResults : Bool;
	
	/**
		Sets the maximum number of `SpeechRecognitionAlternative`s provided per result. The default value is 1.
	**/
	var maxAlternatives : Int;
	
	/**
		Specifies the location of the speech recognition service used by the current `SpeechRecognition` to handle the actual recognition. The default is the user agent's default speech service.
	**/
	var serviceURI : String;
	
	/**
		Fired when the user agent has started to capture audio.
	**/
	var onaudiostart : haxe.Constraints.Function;
	
	/**
		Fired when any sound — recognisable speech or not — has been detected.
	**/
	var onsoundstart : haxe.Constraints.Function;
	
	/**
		Fired when sound that is recognised by the speech recognition service as speech has been detected.
	**/
	var onspeechstart : haxe.Constraints.Function;
	
	/**
		Fired when speech recognised by the speech recognition service has stopped being detected.
	**/
	var onspeechend : haxe.Constraints.Function;
	
	/**
		Fired when any sound — recognisable speech or not — has stopped being detected.
	**/
	var onsoundend : haxe.Constraints.Function;
	
	/**
		Fired when the user agent has finished capturing audio.
	**/
	var onaudioend : haxe.Constraints.Function;
	
	/**
		Fired when the speech recognition service returns a result — a word or phrase has been positively recognized and this has been communicated back to the app.
	**/
	var onresult : haxe.Constraints.Function;
	
	/**
		Fired when the speech recognition service returns a final result with no significant recognition. This may involve some degree of recognition, which doesn't meet or exceed the `SpeechRecognitionAlternative.confidence` threshold.
	**/
	var onnomatch : haxe.Constraints.Function;
	
	/**
		Fired when a speech recognition error occurs.
	**/
	var onerror : haxe.Constraints.Function;
	
	/**
		Fired when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current `SpeechRecognition`.
	**/
	var onstart : haxe.Constraints.Function;
	
	/**
		Fired when the speech recognition service has disconnected.
	**/
	var onend : haxe.Constraints.Function;
	
	/** @throws DOMError */
	function new() : Void;
	
	/**
		Starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current `SpeechRecognition`.
		@throws DOMError
	**/
	function start( ?stream : MediaStream ) : Void;
	
	/**
		Stops the speech recognition service from listening to incoming audio, and attempts to return a `SpeechRecognitionResult` using the audio captured so far.
	**/
	function stop() : Void;
	
	/**
		Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a `SpeechRecognitionResult`.
	**/
	function abort() : Void;
}