Web Speech API позволяет взаимодействовать с голосовыми интерфейсами в ваших веб приложениях. Web Speech API состоит из двух частей: SpeechSynthesis (Текст-в-Речь), и SpeechRecognition (Асинхронное распознавание речи)
Web Speech API позволяет веб приложениям управлять голосовыми данными. Существует два компонента к этому API:
Распознавание голоса. Доступ обеспечивается через SpeechRecognition интерфейс, который в свою очередь обеспечивает возможность распознавать текст из входящего аудио потока (обычно через устройство распознавания речи в устройстве по умолчанию) и отвечать соответственно. Воспользовавшись конструктором интерфейса вы можете создать новый SpeechRecognition объект, у которого есть ряд событий для обнаружения начала речи через микрофон устройства. SpeechGrammar интерфейс предоставляет контейнер для определённого набора грамматики, которое ваше приложение должно использовать. Грамматика определяется с помощью JSpeech Grammar Format (JSGF.)
Доступ к синтезу речи осуществляется с помощью SpeechSynthesis интерфейса, компонент text-to-speech позволяет приложениям прочесть свой текстовый контент (обычно через дефолтный синтезатор речи устройства). В SpeechSynthesisVoice объектах есть различные типы голоса, и различным частям текста можно назначать SpeechSynthesisUtterance объекты. Можно начать воспроизведение передав их методу SpeechSynthesis.speak().
The controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
Represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.)
Represents a voice that the system supports. Every SpeechSynthesisVoice has its own relative speech service including information about language, name and URI.
Specced out as part of a [NoInterfaceObject] interface called SpeechSynthesisGetter, and Implemented by the Window object, the speechSynthesis property provides access to the SpeechSynthesis controller, and therefore the entry point to speech synthesis functionality.
Tip: you can click/tap on a cell for more information.
Full support
Full support
No support
No support
See implementation notes.
Requires a vendor prefix or different name for use.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Tip: you can click/tap on a cell for more information.
Full support
Full support
No support
No support
See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.