Back to Content

SpeechSynthesisEvent: name property

files/en-us/web/api/speechsynthesisevent/name/index.md

latest872 B
Original Source

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

The name read-only property of the {{domxref("SpeechSynthesisUtterance")}} interface returns the name associated with certain types of events occurring as the {{domxref("SpeechSynthesisUtterance.text")}} is being spoken: the name of the SSML marker reached in the case of a {{domxref("SpeechSynthesisUtterance.mark_event", "mark")}} event, or the type of boundary reached in the case of a {{domxref("SpeechSynthesisUtterance.boundary_event", "boundary")}} event.

Value

A string.

Examples

js
utterThis.onboundary = (event) => {
  console.log(
    `${event.name} boundary reached after ${event.elapsedTime} seconds.`,
  );
};

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also