Spec-Zone.ru › Web APIs

SpeechSynthesis: свойство pending

Базовая Широко доступна

Эта функция хорошо зарекомендовала себя и работает на многих устройствах и версиях браузера. Она доступна во всех браузерах с сентября 2018 года.

  • Подробнее
  • Полная совместимость
  • Отправить отзыв

Чтение только свойство pending интерфейса SpeechSynthesis — это булево значение, которое возвращает true значение, если очередь произнесений содержит еще не произнесенные произнесения.

Значение

Булевое значение.

Примеры

const synth = window.speechSynthesis;

const utterance1 = new SpeechSynthesisUtterance(
  "How about we say this now? This is quite a long sentence to say.",
);
const utterance2 = new SpeechSynthesisUtterance(
  "We should say another sentence too, just to be on the safe side.",
);

synth.speak(utterance1);
synth.speak(utterance2);

const amIPending = synth.pending; // will return true if utterance 1 is still being spoken and utterance 2 is in the queue

Спецификации

Спецификация
Web Speech API
# dom-speechsynthesis-pending

Совместимость браузеров

Рабочие столы Мобильные устройства
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari на iOS Samsung Internet WebView Android
pending 33 14 49 21 7 33 62 Нет 7 3.0 Нет

См. также

  • Web Speech API

© 2005–2024 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/pending

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API