GatoTextToSpeech

Inherits: Node

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Properties

String

language

"en"

String

voice_id

int

volume

50

float

pitch

1.0

float

rate

1.0

Methods

void

set_language(country_code: StringName, new_voice_id: StringName = &”default”)

void

read(text: String)

void

stop()

bool

is_reading()

GatoTTSLanguageVoices

get_voices_for_os()

Array[GatoTTSVoiceID]

get_voices_for_language(country_code: StringName)


Signals

reading_started(utterance_id: int) 🔗

Emitted when a TTS reading starts. This is called an utterance. The parameter is the ID associated to this utterance.


reading_stopped(utterance_id: int) 🔗

Emitted when a TTS reading stops. This is called an utterance. The parameter is the ID associated to this utterance.


Constants

DEFAULT_VOICE = &"default" 🔗

There is currently no description for this constant. Please help us by contributing one!


Property Descriptions

String language = "en" 🔗

Voices have different languages and accents for pronunciation. This String identifies what language has been selected and therefore what language the text will be read on.


String voice_id 🔗

Each language can have a number of voices: male, female, robotic, with different accents… Each of those voices has an ID. This String represents the selected voice.


int volume = 50 🔗

How loud or quiet the voice will be. Ranges from 0 (lowest) to 100 (highest).


float pitch = 1.0 🔗

How high or low the voice’s pitch will be. Ranges from 0.0 (lowest) to 2.0 (highest), 1.0 is default pitch for the current voice.


float rate = 1.0 🔗

How fast the text is read. Ranges from 0.1 (lowest) to 10.0 (highest), 1.0 is a normal speaking rate. Other values act as a percentage relative.


Method Descriptions

void set_language(country_code: StringName, new_voice_id: StringName = &”default”) 🔗

Update the language selected. A default voice will be chosen if no “voice_id”\ is passed as the second parameter.

Notice that each OS has different voice IDs, so a voice ID for Windows might not work on Mac or Linux.


void read(text: String) 🔗

Read a text with the previously selected language and voice.


void stop() 🔗

If a message is already being read, it will stop it.


bool is_reading() 🔗

Returns true if a message is already being read. Otherwise, it returns false.


GatoTTSLanguageVoices get_voices_for_os() 🔗

There is currently no description for this method. Please help us by contributing one!


Array[GatoTTSVoiceID] get_voices_for_language(country_code: StringName) 🔗

There is currently no description for this method. Please help us by contributing one!