Table of Contents

Class SpeechSynthesisEvent

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The SpeechSynthesisEvent interface of the Web Speech API contains information about the current state of SpeechSynthesisUtterance objects that have been processed in the speech service.

[Value("SpeechSynthesisEvent")]
public class SpeechSynthesisEvent : Event
Inheritance
SpeechSynthesisEvent
Derived
Inherited Members

Remarks

Constructors

SpeechSynthesisEvent()

public SpeechSynthesisEvent()

SpeechSynthesisEvent(string, SpeechSynthesisEventInit)

The SpeechSynthesisEvent() constructor creates a new SpeechSynthesisEvent object.

public SpeechSynthesisEvent(string type, SpeechSynthesisEventInit eventInitDict)

Parameters

type string
eventInitDict SpeechSynthesisEventInit

Remarks

NOTE

A web developer doesn't typically need to call this constructor, as the browser creates these objects itself when firing events.

-SpeechSynthesisErrorEvent

See also on MDN

Properties

CharIndex

The charIndex read-only property of the SpeechSynthesisUtterance interface returns the index position of the character in Text that was being spoken when the event was triggered.

[Value("charIndex")]
public ulong CharIndex { get; }

Property Value

ulong

A number.

Remarks

CharLength

The read-only charLength property of the SpeechSynthesisEvent interface returns the number of characters left to be spoken after the character at the CharIndex position.

[Value("charLength")]
public ulong CharLength { get; }

Property Value

ulong

An integer.

Remarks

If the speech engine can't determine it, it returns 0.

See also on MDN

ElapsedTime

The elapsedTime read-only property of the SpeechSynthesisEvent returns the elapsed time in seconds, after the Text started being spoken, at which the event was triggered.

[Value("elapsedTime")]
public Number ElapsedTime { get; }

Property Value

Number

A float containing the elapsed time, in seconds.

NOTE
Early versions of the specification required the elapsed time in milliseconds.
Check the compatibility table below for your browser.

Remarks

Name

The name read-only property of the SpeechSynthesisUtterance interface returns the name associated with certain types of events occurring as the Text is being spoken:
the name of the SSML marker reached in the case of a SpeechSynthesisUtterance.Mark event, or the type of boundary reached in the case of a SpeechSynthesisUtterance.Boundary event.

[Value("name")]
public string Name { get; }

Property Value

string

A string.

Remarks

Utterance

The utterance read-only property of the SpeechSynthesisUtterance interface returns the SpeechSynthesisUtterance instance that the event was triggered on.

[Value("utterance")]
public SpeechSynthesisUtterance Utterance { get; }

Property Value

SpeechSynthesisUtterance

A SpeechSynthesisUtterance object.

Remarks