files/en-us/web/api/speechsynthesisutterance/pause_event/index.md
{{APIRef("Web Speech API")}}
The pause event of the Web Speech API {{domxref("SpeechSynthesisUtterance")}} object is fired when the utterance is paused part way through.
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("pause", (event) => { })
onpause = (event) => { }
A {{domxref("SpeechSynthesisEvent")}}. Inherits from {{domxref("Event")}}.
{{InheritanceDiagram("SpeechSynthesisEvent")}}
In addition to the properties listed below, properties from the parent interface, {{domxref("Event")}}, are available.
You can use the pause event in an addEventListener method:
utterThis.addEventListener("pause", (event) => {
console.log(`Speech paused after ${event.elapsedTime} seconds.`);
});
Or use the onpause event handler property:
utterThis.onpause = (event) => {
console.log(`Speech paused after ${event.elapsedTime} seconds.`);
};
{{Specifications}}
{{Compat}}