Table of Contents

Class SpeechSynthesis

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The SpeechSynthesis interface of the Web Speech API is 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.

[Value("SpeechSynthesis")]
public class SpeechSynthesis : EventTarget
Inheritance
SpeechSynthesis
Inherited Members

Remarks

Constructors

SpeechSynthesis()

public SpeechSynthesis()

Properties

Onvoiceschanged

[Value("onvoiceschanged")]
public EventHandlerNonNull Onvoiceschanged { get; set; }

Property Value

EventHandlerNonNull

Paused

The paused read-only property of the
SpeechSynthesis interface is a boolean value that returns
true if the SpeechSynthesis object is in a paused state, or false if not.

[Value("paused")]
public bool Paused { get; }

Property Value

bool

A boolean value.

Remarks

It can be set to Pause() even if nothing is
currently being spoken through it. If
SpeechSynthesisUtterance are then added to the utterance
queue, they will not be spoken until the SpeechSynthesis object is
unpaused, using Resume().

-Web Speech API

See also on MDN

Pending

The pending read-only property of the
SpeechSynthesis interface is a boolean value that returns
true if the utterance queue contains as-yet-unspoken utterances.

[Value("pending")]
public bool Pending { get; }

Property Value

bool

A boolean value.

Remarks

Speaking

The speaking read-only property of the
SpeechSynthesis interface is a boolean value that returns
true if an utterance is currently in the process of being spoken — even
if SpeechSynthesis is in a
SpeechSynthesispause state.

[Value("speaking")]
public bool Speaking { get; }

Property Value

bool

A boolean value.

Remarks

Methods

Cancel()

The cancel() method of the SpeechSynthesis
interface removes all utterances from the utterance queue.

[Value("cancel")]
public GlobalObject.Undefined Cancel()

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

If an utterance is currently being spoken, speaking will stop immediately.

-Web Speech API

See also on MDN

GetVoices()

The getVoices() method of the
SpeechSynthesis interface returns a list of
SpeechSynthesisVoice objects representing all the available voices on the
current device.

[Value("getVoices")]
public List<SpeechSynthesisVoice> GetVoices()

Returns

List<SpeechSynthesisVoice>

A list (array) of SpeechSynthesisVoice objects.

Remarks

Pause()

The pause() method of the SpeechSynthesis
interface puts the SpeechSynthesis object into a paused state.

[Value("pause")]
public GlobalObject.Undefined Pause()

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Resume()

The resume() method of the SpeechSynthesis
interface puts the SpeechSynthesis object into a non-paused state:
resumes it if it was already paused.

[Value("resume")]
public GlobalObject.Undefined Resume()

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks

Speak(SpeechSynthesisUtterance)

The speak() method of the SpeechSynthesis
interface adds an SpeechSynthesisUtterance to the utterance
queue; it will be spoken when any other utterances queued before it have been spoken.

[Value("speak")]
public GlobalObject.Undefined Speak(SpeechSynthesisUtterance utterance)

Parameters

utterance SpeechSynthesisUtterance

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks