docs.rodeo

MDN Web Docs mirror

Web Speech API

{{DefaultAPISidebar("Web Speech API")}} 

The Web Speech API enables you to incorporate voice data into web apps. The Web Speech API has two parts: SpeechSynthesis (Text-to-Speech), and SpeechRecognition (Asynchronous Speech Recognition.)

Web speech concepts and usage

The Web Speech API enables web apps to handle voice data. It has two components:

For more details on using these features, see Using the Web Speech API.

Web Speech API Interfaces

Speech recognition

Speech synthesis

Deprecated interfaces

The concept of grammar has been removed from the Web Speech API. Related features remain in the specification and are still recognized by supporting browsers for backwards compatibility, but they have no effect on speech recognition services.

Errors

For information on errors reported by the Speech API (for example, "language-not-supported" and "language-unavailable"), see the following documentation:

Security considerations

Access to the on-device speech recognition functionality of the Web Speech API is controlled by the {{httpheader("Permissions-Policy/on-device-speech-recognition", "on-device-speech-recognition")}}  {{httpheader("Permissions-Policy")}}  directive.

Specifically, where a defined policy blocks usage, any attempts to call the API’s {{domxref("SpeechRecognition.available_static", "SpeechRecognition.available()")}}  or {{domxref("SpeechRecognition.install_static", "SpeechRecognition.install()")}}  methods will fail.

Examples

Our Web Speech API examples illustrate speech recognition and synthesis.

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN