Skip to content

TWebSpeechSynthesis

TWebSpeechSynthesis is a non-visual component that allows to take advantage of the web speech synthesis API available in all modern browsers. It allows to generate spoken text from a string value.

Methods

Method Description
procedure Speak(AText: string); Generate spoken text for string AText
procedure Cancel; Stop playing the generated spoken text
function GetVoices: TStrings Retrieve the supported voices by the device for the speech synthesis
function IsSpeaking: boolean Returns true when the component is still playing a generated spoken text
Function Supported: boolean Returns true when the device the browser is running on supports speech synthesis

Properties

Property Description
property Pitch: single Sets the pitch of the voice
property Rate: single Sets the rate of the voice
property Voice: string Sets the voice to be used for generating the spoken text
property Voices: TStrings Read-only property returning the available voices on the device
property Volume: single Sets the volume for the spoken text

Events

Event Description
property OnVoicesReady Event triggered when the list of available voices is ready. Retrieval of available voices on the device is an asynchronous process