SpeechRecognition

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

SpeechRecognition interface of the Web 语音 API is the controller interface for the recognition service; this also handles the SpeechRecognitionEvent sent from the recognition service.

注意 : On some browsers, like Chrome, using Speech Recognition on a web page involves a server-based recognition engine. Your audio is sent to a web service for recognition processing, so it won't work offline.

构造函数

SpeechRecognition.SpeechRecognition()
创建新的 SpeechRecognition 对象。

特性

SpeechRecognition also inherits properties from its parent interface, EventTarget .

SpeechRecognition.grammars
Returns and sets a collection of SpeechGrammar objects that represent the grammars that will be understood by the current SpeechRecognition .
SpeechRecognition.lang
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.
SpeechRecognition.continuous
Controls whether continuous results are returned for each recognition, or only a single result. Defaults to single ( false .)
SpeechRecognition.interimResults
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 特性为 false .)
SpeechRecognition.maxAlternatives
Sets the maximum number of SpeechRecognitionAlternative s provided per result. The default value is 1.
SpeechRecognition.serviceURI
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.

方法

SpeechRecognition also inherits methods from its parent interface, EventTarget .

SpeechRecognition.abort()
Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a SpeechRecognitionResult .
SpeechRecognition.start()
Starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition .
SpeechRecognition.stop()
Stops the speech recognition service from listening to incoming audio, and attempts to return a SpeechRecognitionResult using the audio captured so far.

Events

监听这些事件使用 addEventListener() 或通过把事件监听器赋值给 on eventname 特性为此接口。

audiostart
Fired when the user agent has started to capture audio.
Also available via the onaudiostart 特性。
audioend
Fired when the user agent has finished capturing audio.
Also available via the onaudioend 特性。
end
Fired when the speech recognition service has disconnected.
Also available via the onend 特性。
error
Fired when a speech recognition error occurs.
Also available via the onerror 特性。
nomatch
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 confidence threshold.
Also available via the onnomatch 特性。
result
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.
Also available via the onresult 特性。
soundstart
Fired when any sound — recognisable speech or not — has been detected.
Also available via the onsoundstart 特性。
soundend
Fired when any sound — recognisable speech or not — has stopped being detected.
Also available via the onsoundend 特性。
speechstart
Fired when sound that is recognised by the speech recognition service as speech has been detected.
Also available via the onspeechstart 特性。
speechend
Fired when speech recognised by the speech recognition service has stopped being detected.
Also available via the onspeechend 特性。
start
Fired when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition .
Also available via the onstart 特性。

范例

In our simple Speech color changer example, we create a new SpeechRecognition object instance using the SpeechRecognition() constructor, create a new SpeechGrammarList , and set it to be the grammar that will be recognised by the SpeechRecognition instance using the SpeechRecognition.grammars 特性。

After some other values have been defined, we then set it so that the recognition service starts when a click event occurs (see SpeechRecognition.start() .) When a result has been successfully recognised, the SpeechRecognition.onresult handler fires,  we extract the color that was spoken from the event object, and then set the background color of the <html> element to that color.

var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;'
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
speechRecognitionList.addFromString(grammar, 1);
recognition.grammars = speechRecognitionList;
recognition.continuous = false;
recognition.lang = 'en-US';
recognition.interimResults = false;
recognition.maxAlternatives = 1;
var diagnostic = document.querySelector('.output');
var bg = document.querySelector('html');
document.body.onclick = function() {
  recognition.start();
  console.log('Ready to receive a color command.');
}
recognition.onresult = function(event) {
  var color = event.results[0][0].transcript;
  diagnostic.textContent = 'Result received: ' + color;
  bg.style.backgroundColor = color;
}
					

规范

规范 状态 Comment
Web 语音 API
The definition of 'SpeechRecognition' in that specification.
草案

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
SpeechRecognition
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android 4.4.3
Prefixed
4.4.3
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android 2.0
Prefixed
2.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
SpeechRecognition() 构造函数
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android 37
Prefixed
37
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
abort
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
audioend event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
audiostart event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
continuous
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
end event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
error event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
grammars
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
interimResults
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
lang
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
maxAlternatives
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
nomatch event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
onaudioend
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onaudiostart
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onend
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onerror
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onnomatch
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onresult
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onsoundend
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onsoundstart
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onspeechend
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onspeechstart
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
onstart
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
result event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
serviceURI
弃用 非标
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
soundend event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
soundstart event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
speechend event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
speechstart event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
start
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
start event
Chrome 33 Edge 79 Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
stop
Chrome 33
Prefixed
33
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
You'll need to serve your code through a web server for recognition to work.

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
见实现注意事项。
要求使用供应商前缀或不同名称。
要求使用供应商前缀或不同名称。

另请参阅