Skip to main content

SpeechSynthesis

Namespace: Wisej.Web.Ext.Speech

Assembly: Wisej.Web.Ext.Speech

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.

public class SpeechSynthesis : Component, IExtenderProvider

Constructors

Instance memberSpeechSynthesis()

Initializes a new instance of the Speech class.

Properties

Instance memberEnabled

Boolean: Enables or disables the this SpeechSynthesis extender. (Default: True)

Instance memberLanguage

String: Returns or sets the language of the utterance. (Default: "")

Instance memberPitch

Single: Returns and sets the pitch at which the utterance will be spoken at. (Default: 1)

Instance memberRate

Single: Returns and sets the speed at which the utterance will be spoken at. (Default: 1)

Instance memberVoice

String: Returns or sets the voice that will be used to speak the utterance. (Default: "native")

Instance memberVolume

Single: Returns or sets the volume that the utterance will be spoken at. The default is 1 (maximum). (Default: 1)

Methods

Instance memberCancel()

Removes all utterances from the utterance queue. If an utterance is currently being spoken, speaking will stop immediately.

Instance memberCanExtend(target)

Returns true if SpeechSynthesis can offer an extender property to the specified target component.

ParameterTypeDescription
targetObjectThe target object to add an extender property to.

Returns: Boolean. true if the SpeechSynthesis class can offer one or more extender properties; otherwise, false.

Instance memberGetSpeechSynthesis(control)

SpeechSynthesis properties.

ParameterTypeDescription
controlControlThe Control for which to retrieve the speech properties.

Returns: Properties. A Properties instance with the SpeechSynthesis properties.

Instance memberGetVoicesAsync()

Returns: Task<String[]>.

Instance memberPause()

Puts the SpeechSynthesis object into a paused state.

Instance memberRemoveAll()

Removes all speech extenders.

Instance memberResume()

Resumes speaking if the SpeechSynthesis object was already paused.

Instance memberSetSpeechSynthesis(control, speechSynthesis)

ParameterTypeDescription
controlControl
speechSynthesisProperties

Instance memberSpeak(text)

Adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.

ParameterTypeDescription
textString