Main component of RT-Voice. More...

Inheritance diagram for Crosstales.RTVoice.Speaker:
Crosstales.Common.Util.Singleton< Speaker >

Public Member Functions

float ApproximateSpeechLength (string text, float rate=1f, float wordsPerMinute=175f, float timeFactor=0.9f)
 Approximates the speech length in seconds of a given text and rate. Note: This is an experimental method and doesn't provide an exact value; +/- 15% is "normal"! More...
 
bool isVoiceForGenderAvailable (Crosstales.RTVoice.Model.Enum.Gender gender, string culture="")
 Is a voice available for a given gender and optional culture from the current TTS-system? More...
 
bool isVoiceForGenderAvailable (Crosstales.RTVoice.Model.Enum.Gender gender, SystemLanguage language)
 Is a voice available for a given gender and language from the current TTS-system? More...
 
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoicesForGender (Crosstales.RTVoice.Model.Enum.Gender gender, string culture="", bool isFuzzy=false)
 Get all available voices for a given gender and optional culture from the current TTS-system. More...
 
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoicesForGender (Crosstales.RTVoice.Model.Enum.Gender gender, SystemLanguage language, bool isFuzzy=false)
 Get all available voices for a given gender and language from the current TTS-system. More...
 
Crosstales.RTVoice.Model.Voice VoiceForGender (Crosstales.RTVoice.Model.Enum.Gender gender, string culture="", int index=0, string fallbackCulture="en", bool isFuzzy=false)
 Get a voice from for a given gender, optional culture and optional index from the current TTS-system. More...
 
Crosstales.RTVoice.Model.Voice VoiceForGender (Crosstales.RTVoice.Model.Enum.Gender gender, SystemLanguage language, int index=0, bool isFuzzy=false)
 Get a voice from for a given gender, language and index from the current TTS-system. More...
 
bool isVoiceForCultureAvailable (string culture)
 Is a voice available for a given culture from the current TTS-system? More...
 
bool isVoiceForLanguageAvailable (SystemLanguage language)
 Is a voice available for a given language from the current TTS-system? More...
 
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoicesForCulture (string culture, bool isFuzzy=false)
 Get all available voices for a given culture from the current TTS-system. More...
 
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoicesForLanguage (SystemLanguage language, bool isFuzzy=false)
 Get all available voices for a given language from the current TTS-system. More...
 
Crosstales.RTVoice.Model.Voice VoiceForCulture (string culture, int index=0, string fallbackCulture="en", bool isFuzzy=false)
 Get a voice from for a given culture and optional index from the current TTS-system. More...
 
Crosstales.RTVoice.Model.Voice VoiceForLanguage (SystemLanguage language, int index=0, bool isFuzzy=false)
 Get a voice from for a given language and optional index from the current TTS-system. More...
 
bool isVoiceForNameAvailable (string _name, bool isExact=false)
 Is a voice available for a given name from the current TTS-system? More...
 
Crosstales.RTVoice.Model.Voice VoiceForName (string _name, bool isExact=false)
 Get a voice for a given name from the current TTS-system. More...
 
void SpeakNativeWithUID (Crosstales.RTVoice.Model.Wrapper wrapper)
 Speaks a text with a given voice (native mode). More...
 
string SpeakNative (string text, Crosstales.RTVoice.Model.Voice voice=null, float rate=1f, float pitch=1f, float volume=1f, bool forceSSML=true)
 Speaks a text with a given voice (native mode). More...
 
string SpeakNative (Crosstales.RTVoice.Model.Wrapper wrapper)
 Speaks a text with a given wrapper (native mode). More...
 
void SpeakWithUID (Crosstales.RTVoice.Model.Wrapper wrapper)
 Speaks a text with a given voice. More...
 
string Speak (string text, AudioSource source=null, Crosstales.RTVoice.Model.Voice voice=null, bool speakImmediately=true, float rate=1f, float pitch=1f, float volume=1f, string outputFile="", bool forceSSML=true)
 Speaks a text with a given voice. More...
 
string Speak (Crosstales.RTVoice.Model.Wrapper wrapper)
 Speaks a text with a given wrapper. More...
 
void SpeakMarkedWordsWithUID (Crosstales.RTVoice.Model.Wrapper wrapper)
 Speaks and marks a text with a given wrapper. More...
 
void SpeakMarkedWordsWithUID (string uid, string text, AudioSource source, Crosstales.RTVoice.Model.Voice voice=null, float rate=1f, float pitch=1f, bool forceSSML=true)
 Speaks and marks a text with a given voice and tracks the word position. More...
 
string Generate (Crosstales.RTVoice.Model.Wrapper wrapper)
 Generates an audio file from a given wrapper. More...
 
string Generate (string text, string outputFile, Crosstales.RTVoice.Model.Voice voice=null, float rate=1f, float pitch=1f, float volume=1f, bool forceSSML=true)
 Generates an audio file from a text with a given voice. More...
 
void Silence (string uid=null)
 Silence all active TTS-voices (optional with a UID). More...
 
void Pause (string uid=null)
 Pause all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void UnPause (string uid=null)
 Un-Pause all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void PauseOrUnPause (string uid=null)
 Pause or unpause all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void Mute (string uid=null)
 Mute all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void UnMute (string uid=null)
 Un-mute all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void MuteOrUnMute (string uid=null)
 Mute or unmute all active TTS-voices (optional with a UID, only for 'Speak'-calls). More...
 
void ReloadProvider ()
 Reloads the provider. More...
 
void DeleteAudioFiles ()
 Deletes all generated audio files. More...
 
void SetVoices (string voices)
 Sets all voices from iOS. More...
 
void WordSpoken (string word)
 The current spoken word from iOS. More...
 
void SetState (string state)
 Sets the state from iOS. More...
 

Static Public Member Functions

static void ResetObject ()
 Resets this object. More...
 
- Static Public Member Functions inherited from Crosstales.Common.Util.Singleton< Speaker >
static void CreateInstance (bool searchExistingGameObject=true, bool deleteExistingInstance=false)
 Creates an instance of this object. More...
 
static void DeleteInstance ()
 Deletes the instance of this object. More...
 

Public Attributes

bool isSpeaking => SpeechCount > 0
 Checks if RT-Voice is speaking on this system. More...
 
bool isBusy => BusyCount > 0
 Checks if RT-Voice is busy on this system. More...
 
bool isPlatformSupported => voiceProvider?.isPlatformSupported == true
 Indicates if this TTS-system is supporting the current platform. More...
 
VoicesReadyEvent OnReady
 
SpeakStartEvent OnSpeakStarted
 
SpeakCompleteEvent OnSpeakCompleted
 
ProviderChangeEvent OnProviderChanged
 
ErrorEvent OnError
 

Protected Member Functions

override void Awake ()
 
override void OnDestroy ()
 
override void OnApplicationQuit ()
 

Properties

Crosstales.RTVoice.Provider.BaseCustomVoiceProvider CustomProvider [get, set]
 Custom provider for RT-Voice. More...
 
bool CustomMode [get, set]
 Enables or disables the custom provider. More...
 
bool ESpeakMode [get, set]
 Enable or disable eSpeak for standalone platforms. More...
 
string ESpeakApplication [get, set]
 eSpeak application name/path. More...
 
string ESpeakDataPath [get, set]
 eSpeak application data path. More...
 
Crosstales.RTVoice.Model.Enum.ESpeakModifiers ESpeakModifier [get, set]
 Active modifier for all eSpeak voices. More...
 
string AndroidEngine [get, set]
 Active speech engine under Android. Note: the default Google Engine is "com.google.android.tts" More...
 
bool WindowsForce32bit [get, set]
 Force 32bit under Windows standalone More...
 
bool AutoClearTags [get, set]
 Automatically clear tags from speeches depending on the capabilities of the current TTS-system. More...
 
bool Caching [get, set]
 Enable or disable the caching of generated speeches. More...
 
bool SilenceOnDisable [get, set]
 Silence any speeches if this component gets disabled. More...
 
bool SilenceOnFocusLost [get, set]
 Silence any speeches if the application loses the focus. More...
 
bool HandleFocus [get, set]
 Starts and stops the Speaker depending on the focus and running state. More...
 
int? SpeechCount [get]
 Number of active speeches. More...
 
int? BusyCount [get]
 Number of active calls. More...
 
bool areVoicesReady [get]
 Are all voices ready to speak? More...
 
bool isTTSAvailable [get]
 Checks if TTS is available on this system. More...
 
bool enforcedStandaloneTTS [get]
 Is standalone TTS enforced? More...
 
bool isPaused [get]
 Is RT-Voice paused? More...
 
bool isMuted [get]
 Is RT-Voice muted? More...
 
string AudioFileExtension [get]
 Returns the extension of the generated audio files. More...
 
string DefaultVoiceName [get]
 Returns the default voice name of the current TTS-provider. More...
 
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoices [get]
 Get all available voices from the current TTS-system. More...
 
bool isWorkingInEditor [get]
 Indicates if this TTS-system is working directly inside the Unity Editor (without 'Play'-mode). More...
 
bool isWorkingInPlaymode [get]
 Indicates if this TTS-system is working with 'Play'-mode inside the Unity Editor. More...
 
int MaxTextLength [get]
 Maximal length of the speech text (in characters) for the current TTS-system. More...
 
bool isSpeakNativeSupported [get]
 Indicates if this TTS-system is supporting SpeakNative. More...
 
bool isSpeakSupported [get]
 Indicates if this TTS-system is supporting Speak. More...
 
bool isSSMLSupported [get]
 Indicates if this TTS-system is supporting SSML. More...
 
bool isOnlineService [get]
 Indicates if this TTS-system is an online service like MaryTTS or AWS Polly. More...
 
bool hasCoRoutines [get]
 Indicates if this TTS-system uses co-routines. More...
 
bool isIL2CPPSupported [get]
 Indicates if this TTS-system is supporting IL2CPP. More...
 
bool hasVoicesInEditor [get]
 Indicates if this provider returns voices in the Editor mode. More...
 
int MaxSimultaneousSpeeches [get]
 Maximal number of simultaneous speeches (0 = unlimited). More...
 
System.Collections.Generic.List< string > Cultures [get]
 Get all available cultures from the current TTS-system (ISO 639-1). More...
 
System.Collections.Generic.List< SystemLanguage > Languages [get]
 Get all available languages from the current TTS-system. More...
 
System.Collections.Generic.List< string > Engines [get]
 Get all available speech engines (works only for Android). More...
 
- Properties inherited from Crosstales.Common.Util.Singleton< Speaker >
static T Instance [get, protected set]
 Returns the singleton instance of this class. More...
 
bool DontDestroy [get, set]
 Don't destroy gameobject during scene switches. More...
 

Events

VoicesReady OnVoicesReady
 An event triggered whenever the voices of a provider are ready. More...
 
SpeakStart OnSpeakStart
 An event triggered whenever a speak is started. More...
 
SpeakComplete OnSpeakComplete
 An event triggered whenever a speak is completed. More...
 
SpeakCurrentWord OnSpeakCurrentWord
 An event triggered whenever a new word is spoken (native, Windows and iOS only). More...
 
SpeakCurrentWordString OnSpeakCurrentWordString
 An event triggered whenever a new word is spoken (native, Windows and iOS only). More...
 
SpeakCurrentPhoneme OnSpeakCurrentPhoneme
 An event triggered whenever a new phoneme is spoken (native, Windows only). More...
 
SpeakCurrentViseme OnSpeakCurrentViseme
 An event triggered whenever a new viseme is spoken (native, Windows only). More...
 
SpeakAudioGenerationStart OnSpeakAudioGenerationStart
 An event triggered whenever a speak audio generation is started. More...
 
SpeakAudioGenerationComplete OnSpeakAudioGenerationComplete
 An event triggered whenever a speak audio generation is completed. More...
 
ProviderChange OnProviderChange
 An event triggered whenever a provider changes (e.g. Windows to MaryTTS). More...
 
ErrorInfo OnErrorInfo
 An event triggered whenever an error occurs. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Crosstales.Common.Util.Singleton< Speaker >
static string PrefabPath
 Fully qualified prefab path. More...
 
static string GameObjectName
 Name of the gameobject in the scene. More...
 
- Static Protected Attributes inherited from Crosstales.Common.Util.Singleton< Speaker >
static T instance
 

Detailed Description

Main component of RT-Voice.

Member Function Documentation

◆ ApproximateSpeechLength()

float Crosstales.RTVoice.Speaker.ApproximateSpeechLength ( string  text,
float  rate = 1f,
float  wordsPerMinute = 175f,
float  timeFactor = 0.9f 
)

Approximates the speech length in seconds of a given text and rate. Note: This is an experimental method and doesn't provide an exact value; +/- 15% is "normal"!

Parameters
textText for the length approximation.
rateSpeech rate of the speaker in percent for the length approximation (1 = 100%, default: 1, optional).
wordsPerMinuteWords per minute (default: 175, optional).
timeFactorTime factor for the calculated value (default: 0.9, optional).
Returns
Approximated speech length in seconds of the given text and rate.

◆ DeleteAudioFiles()

void Crosstales.RTVoice.Speaker.DeleteAudioFiles ( )

Deletes all generated audio files.

◆ Generate() [1/2]

string Crosstales.RTVoice.Speaker.Generate ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Generates an audio file from a given wrapper.

Parameters
wrapperSpeak wrapper.
Returns
UID of the generator.

◆ Generate() [2/2]

string Crosstales.RTVoice.Speaker.Generate ( string  text,
string  outputFile,
Crosstales.RTVoice.Model.Voice  voice = null,
float  rate = 1f,
float  pitch = 1f,
float  volume = 1f,
bool  forceSSML = true 
)

Generates an audio file from a text with a given voice.

Parameters
textText to generate.
outputFileSaves the generated audio to an output file (without extension).
voiceVoice to speak (optional).
rateSpeech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional).
pitchPitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional).
volumeVolume of the speaker in percent (1 = 100%, values: 0.01-1, default: 1, optional).
forceSSMLForce SSML on supported platforms (default: true, optional).
Returns
UID of the generator.

◆ isVoiceForCultureAvailable()

bool Crosstales.RTVoice.Speaker.isVoiceForCultureAvailable ( string  culture)

Is a voice available for a given culture from the current TTS-system?

Parameters
cultureCulture of the voice (e.g. "en")
Returns
True if a voice is available for a given culture.

◆ isVoiceForGenderAvailable() [1/2]

bool Crosstales.RTVoice.Speaker.isVoiceForGenderAvailable ( Crosstales.RTVoice.Model.Enum.Gender  gender,
string  culture = "" 
)

Is a voice available for a given gender and optional culture from the current TTS-system?

Parameters
genderGender of the voice
cultureCulture of the voice (e.g. "en", optional)
Returns
True if a voice is available for a given gender and culture.

◆ isVoiceForGenderAvailable() [2/2]

bool Crosstales.RTVoice.Speaker.isVoiceForGenderAvailable ( Crosstales.RTVoice.Model.Enum.Gender  gender,
SystemLanguage  language 
)

Is a voice available for a given gender and language from the current TTS-system?

Parameters
genderGender of the voice
languageLanguage of the voice
Returns
True if a voice is available for a given gender and language.

◆ isVoiceForLanguageAvailable()

bool Crosstales.RTVoice.Speaker.isVoiceForLanguageAvailable ( SystemLanguage  language)

Is a voice available for a given language from the current TTS-system?

Parameters
languageLanguage of the voice
Returns
True if a voice is available for a given language.

◆ isVoiceForNameAvailable()

bool Crosstales.RTVoice.Speaker.isVoiceForNameAvailable ( string  _name,
bool  isExact = false 
)

Is a voice available for a given name from the current TTS-system?

Parameters
_nameName of the voice (e.g. "Alex")
isExactExact match for the voice name (default: false, optional)
Returns
True if a voice is available for a given name.

◆ Mute()

void Crosstales.RTVoice.Speaker.Mute ( string  uid = null)

Mute all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ MuteOrUnMute()

void Crosstales.RTVoice.Speaker.MuteOrUnMute ( string  uid = null)

Mute or unmute all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ Pause()

void Crosstales.RTVoice.Speaker.Pause ( string  uid = null)

Pause all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ PauseOrUnPause()

void Crosstales.RTVoice.Speaker.PauseOrUnPause ( string  uid = null)

Pause or unpause all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ ReloadProvider()

void Crosstales.RTVoice.Speaker.ReloadProvider ( )

Reloads the provider.

◆ ResetObject()

static void Crosstales.RTVoice.Speaker.ResetObject ( )
static

Resets this object.

◆ SetState()

void Crosstales.RTVoice.Speaker.SetState ( string  state)

Sets the state from iOS.

Parameters
voicesState from iOS.

◆ SetVoices()

void Crosstales.RTVoice.Speaker.SetVoices ( string  voices)

Sets all voices from iOS.

Parameters
voicesAll voices from iOS.

◆ Silence()

void Crosstales.RTVoice.Speaker.Silence ( string  uid = null)

Silence all active TTS-voices (optional with a UID).

Parameters
uidUID of the speaker (optional)

◆ Speak() [1/2]

string Crosstales.RTVoice.Speaker.Speak ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Speaks a text with a given wrapper.

Parameters
wrapperSpeak wrapper.
Returns
UID of the speaker.

◆ Speak() [2/2]

string Crosstales.RTVoice.Speaker.Speak ( string  text,
AudioSource  source = null,
Crosstales.RTVoice.Model.Voice  voice = null,
bool  speakImmediately = true,
float  rate = 1f,
float  pitch = 1f,
float  volume = 1f,
string  outputFile = "",
bool  forceSSML = true 
)

Speaks a text with a given voice.

Parameters
textText to speak.
sourceAudioSource for the output (optional).
voiceVoice to speak (optional).
speakImmediatelySpeak the text immediately (default: true). Only works if 'Source' is not null.
rateSpeech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional).
pitchPitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional).
volumeVolume of the speaker in percent (1 = 100%, values: 0.01-1, default: 1, optional).
outputFileSaves the generated audio to an output file (without extension, optional).
forceSSMLForce SSML on supported platforms (default: true, optional).
Returns
UID of the speaker.

◆ SpeakMarkedWordsWithUID() [1/2]

void Crosstales.RTVoice.Speaker.SpeakMarkedWordsWithUID ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Speaks and marks a text with a given wrapper.

Parameters
wrapperSpeak wrapper.

◆ SpeakMarkedWordsWithUID() [2/2]

void Crosstales.RTVoice.Speaker.SpeakMarkedWordsWithUID ( string  uid,
string  text,
AudioSource  source,
Crosstales.RTVoice.Model.Voice  voice = null,
float  rate = 1f,
float  pitch = 1f,
bool  forceSSML = true 
)

Speaks and marks a text with a given voice and tracks the word position.

Parameters
uidUID of the speaker
textText to speak.
sourceAudioSource for the output.
voiceVoice to speak (optional).
rateSpeech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional).
pitchPitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional).
forceSSMLForce SSML on supported platforms (default: true, optional).

◆ SpeakNative() [1/2]

string Crosstales.RTVoice.Speaker.SpeakNative ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Speaks a text with a given wrapper (native mode).

Parameters
wrapperSpeak wrapper.
Returns
UID of the speaker.

◆ SpeakNative() [2/2]

string Crosstales.RTVoice.Speaker.SpeakNative ( string  text,
Crosstales.RTVoice.Model.Voice  voice = null,
float  rate = 1f,
float  pitch = 1f,
float  volume = 1f,
bool  forceSSML = true 
)

Speaks a text with a given voice (native mode).

Parameters
textText to speak.
voiceVoice to speak (optional).
rateSpeech rate of the speaker in percent (1 = 100%, values: 0.01-3, default: 1, optional).
pitchPitch of the speech in percent (1 = 100%, values: 0-2, default: 1, optional).
volumeVolume of the speaker in percent (1 = 100%, values: 0.01-1, default: 1, optional).
forceSSMLForce SSML on supported platforms (default: true, optional).
Returns
UID of the speaker.

◆ SpeakNativeWithUID()

void Crosstales.RTVoice.Speaker.SpeakNativeWithUID ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Speaks a text with a given voice (native mode).

Parameters
wrapperSpeak wrapper.

◆ SpeakWithUID()

void Crosstales.RTVoice.Speaker.SpeakWithUID ( Crosstales.RTVoice.Model.Wrapper  wrapper)

Speaks a text with a given voice.

Parameters
wrapperSpeak wrapper.

◆ UnMute()

void Crosstales.RTVoice.Speaker.UnMute ( string  uid = null)

Un-mute all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ UnPause()

void Crosstales.RTVoice.Speaker.UnPause ( string  uid = null)

Un-Pause all active TTS-voices (optional with a UID, only for 'Speak'-calls).

Parameters
uidUID of the speaker (optional)

◆ VoiceForCulture()

Crosstales.RTVoice.Model.Voice Crosstales.RTVoice.Speaker.VoiceForCulture ( string  culture,
int  index = 0,
string  fallbackCulture = "en",
bool  isFuzzy = false 
)

Get a voice from for a given culture and optional index from the current TTS-system.

Parameters
cultureCulture of the voice (e.g. "en")
indexIndex of the voice (default: 0, optional)
fallbackCultureFallback culture of the voice (default "en", optional)
isFuzzyAlways returns voices if there is no match with the culture (default: false, optional)
Returns
Voice for the given culture and index.

◆ VoiceForGender() [1/2]

Crosstales.RTVoice.Model.Voice Crosstales.RTVoice.Speaker.VoiceForGender ( Crosstales.RTVoice.Model.Enum.Gender  gender,
string  culture = "",
int  index = 0,
string  fallbackCulture = "en",
bool  isFuzzy = false 
)

Get a voice from for a given gender, optional culture and optional index from the current TTS-system.

Parameters
genderGender of the voice
cultureCulture of the voice (e.g. "en", optional)
indexIndex of the voice (default: 0, optional)
fallbackCultureFallback culture of the voice (default "en", optional)
isFuzzyAlways returns voices if there is no match with the gender and/or culture (default: false, optional)
Returns
Voice for the given gender, culture and index.

◆ VoiceForGender() [2/2]

Crosstales.RTVoice.Model.Voice Crosstales.RTVoice.Speaker.VoiceForGender ( Crosstales.RTVoice.Model.Enum.Gender  gender,
SystemLanguage  language,
int  index = 0,
bool  isFuzzy = false 
)

Get a voice from for a given gender, language and index from the current TTS-system.

Parameters
genderGender of the voice
languageLanguage of the voice
indexIndex of the voice (default: 0, optional)
isFuzzyAlways returns voices if there is no match with the gender and/or language (default: false, optional)
Returns
Voice for the given gender, language and index.

◆ VoiceForLanguage()

Crosstales.RTVoice.Model.Voice Crosstales.RTVoice.Speaker.VoiceForLanguage ( SystemLanguage  language,
int  index = 0,
bool  isFuzzy = false 
)

Get a voice from for a given language and optional index from the current TTS-system.

Parameters
languagelanguage of the voice
indexIndex of the voice (default: 0, optional)
isFuzzyAlways returns voices if there is no match with the language (default: false, optional)
Returns
Voice for the given language and index.

◆ VoiceForName()

Crosstales.RTVoice.Model.Voice Crosstales.RTVoice.Speaker.VoiceForName ( string  _name,
bool  isExact = false 
)

Get a voice for a given name from the current TTS-system.

Parameters
_nameName of the voice (e.g. "Alex")
isExactExact match for the voice name (default: false, optional)
Returns
Voice for the given name or null if not found.

◆ VoicesForCulture()

System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice> Crosstales.RTVoice.Speaker.VoicesForCulture ( string  culture,
bool  isFuzzy = false 
)

Get all available voices for a given culture from the current TTS-system.

Parameters
cultureCulture of the voice (e.g. "en")
isFuzzyAlways returns voices if there is no match with the culture (default: false, optional)
Returns
All available voices (alphabetically ordered by 'Name') for a given culture as a list.

◆ VoicesForGender() [1/2]

System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice> Crosstales.RTVoice.Speaker.VoicesForGender ( Crosstales.RTVoice.Model.Enum.Gender  gender,
string  culture = "",
bool  isFuzzy = false 
)

Get all available voices for a given gender and optional culture from the current TTS-system.

Parameters
genderGender of the voice
cultureCulture of the voice (e.g. "en", optional)
isFuzzyAlways returns voices if there is no match with the gender and/or culture (default: false, optional)
Returns
All available voices (alphabetically ordered by 'Name') for a given gender and culture as a list.

◆ VoicesForGender() [2/2]

System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice> Crosstales.RTVoice.Speaker.VoicesForGender ( Crosstales.RTVoice.Model.Enum.Gender  gender,
SystemLanguage  language,
bool  isFuzzy = false 
)

Get all available voices for a given gender and language from the current TTS-system.

Parameters
genderGender of the voice
languageLanguage of the voice
isFuzzyAlways returns voices if there is no match with the gender and/or language (default: false, optional)
Returns
All available voices (alphabetically ordered by 'Name') for a given gender and language as a list.

◆ VoicesForLanguage()

System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice> Crosstales.RTVoice.Speaker.VoicesForLanguage ( SystemLanguage  language,
bool  isFuzzy = false 
)

Get all available voices for a given language from the current TTS-system.

Parameters
languageLanguage of the voice
isFuzzyAlways returns voices if there is no match with the language (default: false, optional)
Returns
All available voices (alphabetically ordered by 'Name') for a given language as a list.

◆ WordSpoken()

void Crosstales.RTVoice.Speaker.WordSpoken ( string  word)

The current spoken word from iOS.

Parameters
voicesCurrent spoken word from iOS.

Member Data Documentation

◆ isBusy

bool Crosstales.RTVoice.Speaker.isBusy => BusyCount > 0

Checks if RT-Voice is busy on this system.

Returns
True if RT-Voice is busy on this system.

◆ isPlatformSupported

bool Crosstales.RTVoice.Speaker.isPlatformSupported => voiceProvider?.isPlatformSupported == true

Indicates if this TTS-system is supporting the current platform.

Returns
True if this TTS-system supports current platform.

◆ isSpeaking

bool Crosstales.RTVoice.Speaker.isSpeaking => SpeechCount > 0

Checks if RT-Voice is speaking on this system.

Returns
True if RT-Voice is speaking on this system.

Property Documentation

◆ AndroidEngine

string Crosstales.RTVoice.Speaker.AndroidEngine
getset

Active speech engine under Android. Note: the default Google Engine is "com.google.android.tts"

◆ areVoicesReady

bool Crosstales.RTVoice.Speaker.areVoicesReady
get

Are all voices ready to speak?

◆ AudioFileExtension

string Crosstales.RTVoice.Speaker.AudioFileExtension
get

Returns the extension of the generated audio files.

Returns
Extension of the generated audio files.

◆ AutoClearTags

bool Crosstales.RTVoice.Speaker.AutoClearTags
getset

Automatically clear tags from speeches depending on the capabilities of the current TTS-system.

◆ BusyCount

int? Crosstales.RTVoice.Speaker.BusyCount
get

Number of active calls.

◆ Caching

bool Crosstales.RTVoice.Speaker.Caching
getset

Enable or disable the caching of generated speeches.

◆ Cultures

System.Collections.Generic.List<string> Crosstales.RTVoice.Speaker.Cultures
get

Get all available cultures from the current TTS-system (ISO 639-1).

Returns
All available cultures (alphabetically ordered by 'Culture') as a list.

◆ CustomMode

bool Crosstales.RTVoice.Speaker.CustomMode
getset

Enables or disables the custom provider.

◆ CustomProvider

Crosstales.RTVoice.Provider.BaseCustomVoiceProvider Crosstales.RTVoice.Speaker.CustomProvider
getset

Custom provider for RT-Voice.

◆ DefaultVoiceName

string Crosstales.RTVoice.Speaker.DefaultVoiceName
get

Returns the default voice name of the current TTS-provider.

Returns
Default voice name of the current TTS-provider.

◆ enforcedStandaloneTTS

bool Crosstales.RTVoice.Speaker.enforcedStandaloneTTS
get

Is standalone TTS enforced?

◆ Engines

System.Collections.Generic.List<string> Crosstales.RTVoice.Speaker.Engines
get

Get all available speech engines (works only for Android).

Returns
All available speech engines as a list.

◆ ESpeakApplication

string Crosstales.RTVoice.Speaker.ESpeakApplication
getset

eSpeak application name/path.

◆ ESpeakDataPath

string Crosstales.RTVoice.Speaker.ESpeakDataPath
getset

eSpeak application data path.

◆ ESpeakMode

bool Crosstales.RTVoice.Speaker.ESpeakMode
getset

Enable or disable eSpeak for standalone platforms.

◆ ESpeakModifier

Crosstales.RTVoice.Model.Enum.ESpeakModifiers Crosstales.RTVoice.Speaker.ESpeakModifier
getset

Active modifier for all eSpeak voices.

◆ HandleFocus

bool Crosstales.RTVoice.Speaker.HandleFocus
getset

Starts and stops the Speaker depending on the focus and running state.

◆ hasCoRoutines

bool Crosstales.RTVoice.Speaker.hasCoRoutines
get

Indicates if this TTS-system uses co-routines.

Returns
True if this TTS-system uses co-routines.

◆ hasVoicesInEditor

bool Crosstales.RTVoice.Speaker.hasVoicesInEditor
get

Indicates if this provider returns voices in the Editor mode.

Returns
True if this provider returns voices in the Editor mode.

◆ isIL2CPPSupported

bool Crosstales.RTVoice.Speaker.isIL2CPPSupported
get

Indicates if this TTS-system is supporting IL2CPP.

Returns
True if this TTS-system supports IL2CPP.

◆ isMuted

bool Crosstales.RTVoice.Speaker.isMuted
get

Is RT-Voice muted?

◆ isOnlineService

bool Crosstales.RTVoice.Speaker.isOnlineService
get

Indicates if this TTS-system is an online service like MaryTTS or AWS Polly.

Returns
True if this TTS-system is an online service.

◆ isPaused

bool Crosstales.RTVoice.Speaker.isPaused
get

Is RT-Voice paused?

◆ isSpeakNativeSupported

bool Crosstales.RTVoice.Speaker.isSpeakNativeSupported
get

Indicates if this TTS-system is supporting SpeakNative.

Returns
True if this TTS-system supports SpeakNative.

◆ isSpeakSupported

bool Crosstales.RTVoice.Speaker.isSpeakSupported
get

Indicates if this TTS-system is supporting Speak.

Returns
True if this TTS-system supports Speak.

◆ isSSMLSupported

bool Crosstales.RTVoice.Speaker.isSSMLSupported
get

Indicates if this TTS-system is supporting SSML.

Returns
True if this TTS-system supports SSML.

◆ isTTSAvailable

bool Crosstales.RTVoice.Speaker.isTTSAvailable
get

Checks if TTS is available on this system.

Returns
True if TTS is available on this system.

◆ isWorkingInEditor

bool Crosstales.RTVoice.Speaker.isWorkingInEditor
get

Indicates if this TTS-system is working directly inside the Unity Editor (without 'Play'-mode).

Returns
True if this TTS-system is working directly inside the Unity Editor.

◆ isWorkingInPlaymode

bool Crosstales.RTVoice.Speaker.isWorkingInPlaymode
get

Indicates if this TTS-system is working with 'Play'-mode inside the Unity Editor.

Returns
True if this TTS-system is working with 'Play'-mode inside the Unity Editor.

◆ Languages

System.Collections.Generic.List<SystemLanguage> Crosstales.RTVoice.Speaker.Languages
get

Get all available languages from the current TTS-system.

Returns
All available languages as a list.

◆ MaxSimultaneousSpeeches

int Crosstales.RTVoice.Speaker.MaxSimultaneousSpeeches
get

Maximal number of simultaneous speeches (0 = unlimited).

Returns
The maximal number of simultaneous speeches.

◆ MaxTextLength

int Crosstales.RTVoice.Speaker.MaxTextLength
get

Maximal length of the speech text (in characters) for the current TTS-system.

Returns
The maximal length of the speech text.

◆ SilenceOnDisable

bool Crosstales.RTVoice.Speaker.SilenceOnDisable
getset

Silence any speeches if this component gets disabled.

◆ SilenceOnFocusLost

bool Crosstales.RTVoice.Speaker.SilenceOnFocusLost
getset

Silence any speeches if the application loses the focus.

◆ SpeechCount

int? Crosstales.RTVoice.Speaker.SpeechCount
get

Number of active speeches.

◆ Voices

System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice> Crosstales.RTVoice.Speaker.Voices
get

Get all available voices from the current TTS-system.

Returns
All available voices (alphabetically ordered by 'Name') as a list.

◆ WindowsForce32bit

bool Crosstales.RTVoice.Speaker.WindowsForce32bit
getset

Force 32bit under Windows standalone

Event Documentation

◆ OnErrorInfo

ErrorInfo Crosstales.RTVoice.Speaker.OnErrorInfo

An event triggered whenever an error occurs.

◆ OnProviderChange

ProviderChange Crosstales.RTVoice.Speaker.OnProviderChange

An event triggered whenever a provider changes (e.g. Windows to MaryTTS).

◆ OnSpeakAudioGenerationComplete

SpeakAudioGenerationComplete Crosstales.RTVoice.Speaker.OnSpeakAudioGenerationComplete

An event triggered whenever a speak audio generation is completed.

◆ OnSpeakAudioGenerationStart

SpeakAudioGenerationStart Crosstales.RTVoice.Speaker.OnSpeakAudioGenerationStart

An event triggered whenever a speak audio generation is started.

◆ OnSpeakComplete

SpeakComplete Crosstales.RTVoice.Speaker.OnSpeakComplete

An event triggered whenever a speak is completed.

◆ OnSpeakCurrentPhoneme

SpeakCurrentPhoneme Crosstales.RTVoice.Speaker.OnSpeakCurrentPhoneme

An event triggered whenever a new phoneme is spoken (native, Windows only).

◆ OnSpeakCurrentViseme

SpeakCurrentViseme Crosstales.RTVoice.Speaker.OnSpeakCurrentViseme

An event triggered whenever a new viseme is spoken (native, Windows only).

◆ OnSpeakCurrentWord

SpeakCurrentWord Crosstales.RTVoice.Speaker.OnSpeakCurrentWord

An event triggered whenever a new word is spoken (native, Windows and iOS only).

◆ OnSpeakCurrentWordString

SpeakCurrentWordString Crosstales.RTVoice.Speaker.OnSpeakCurrentWordString

An event triggered whenever a new word is spoken (native, Windows and iOS only).

◆ OnSpeakStart

SpeakStart Crosstales.RTVoice.Speaker.OnSpeakStart

An event triggered whenever a speak is started.

◆ OnVoicesReady

VoicesReady Crosstales.RTVoice.Speaker.OnVoicesReady

An event triggered whenever the voices of a provider are ready.


The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/RTVoice/RTVoicePro/Assets/Plugins/crosstales/RTVoice/Scripts/Speaker.cs