Base class for custom voice providers (TTS-systems). More...

Public Member Functions | |
virtual void | Silence () |
Silence all active TTS-providers. More... | |
virtual void | Silence (string uid) |
Silence the current TTS-provider (native mode). More... | |
abstract IEnumerator | SpeakNative (Crosstales.RTVoice.Model.Wrapper wrapper) |
The current provider speaks a text with a given voice (native mode). More... | |
abstract IEnumerator | Speak (Crosstales.RTVoice.Model.Wrapper wrapper) |
The current provider speaks a text with a given voice. More... | |
abstract IEnumerator | Generate (Crosstales.RTVoice.Model.Wrapper wrapper) |
The current provider generates an audio file from a text with a given voice. More... | |
virtual IEnumerator | SpeakWithClip (Crosstales.RTVoice.Model.Wrapper wrapper, AudioClip clip) |
The provider speaks a text with a given AudioClip. More... | |
abstract void | Load (bool forceReload=false) |
Load the provider (e.g. all voices). More... | |
abstract void | SpeakNativeInEditor (Crosstales.RTVoice.Model.Wrapper wrapper) |
The current provider speaks a text with a given voice (native mode & Editor only). More... | |
abstract void | GenerateInEditor (Crosstales.RTVoice.Model.Wrapper wrapper) |
Generates an audio file with the current provider (Editor only). More... | |
Public Attributes | |
virtual string | DefaultVoiceName => string.Empty |
virtual System.Collections.Generic.List< Crosstales.RTVoice.Model.Voice > | Voices => cachedVoices |
Protected Member Functions | |
virtual void | Start () |
virtual void | OnDestroy () |
virtual string | getOutputFile (string uid, bool isPersistentData=false) |
virtual IEnumerator | playAudioFile (Crosstales.RTVoice.Model.Wrapper wrapper, AudioClip ac, bool isNative=false) |
virtual IEnumerator | playAudioFile (Crosstales.RTVoice.Model.Wrapper wrapper, string url, string outputFile, AudioType type=AudioType.WAV, bool isNative=false, bool isLocalFile=true, System.Collections.Generic.Dictionary< string, string > headers=null) |
virtual void | copyAudioFile (Crosstales.RTVoice.Model.Wrapper wrapper, string outputFile, bool isLocalFile=true, byte[] data=null) |
virtual void | processAudioFile (Crosstales.RTVoice.Model.Wrapper wrapper, string outputFile, bool isLocalFile=true, byte[] data=null) |
virtual string | getVoiceName (Crosstales.RTVoice.Model.Wrapper wrapper) |
void | onVoicesReady () |
void | onSpeakStart (Crosstales.RTVoice.Model.Wrapper wrapper) |
void | onSpeakComplete (Crosstales.RTVoice.Model.Wrapper wrapper) |
void | onSpeakCurrentWord (Crosstales.RTVoice.Model.Wrapper wrapper, string[] speechTextArray, int wordIndex) |
void | onSpeakCurrentWord (Crosstales.RTVoice.Model.Wrapper wrapper, string word) |
void | onSpeakCurrentPhoneme (Crosstales.RTVoice.Model.Wrapper wrapper, string phoneme) |
void | onSpeakCurrentViseme (Crosstales.RTVoice.Model.Wrapper wrapper, string viseme) |
void | onSpeakAudioGenerationStart (Crosstales.RTVoice.Model.Wrapper wrapper) |
void | onSpeakAudioGenerationComplete (Crosstales.RTVoice.Model.Wrapper wrapper) |
void | onErrorInfo (Crosstales.RTVoice.Model.Wrapper wrapper, string info) |
Static Protected Member Functions | |
static string | getValidXML (string xml) |
Protected Attributes | |
System.Collections.Generic.List< Crosstales.RTVoice.Model.Voice > | cachedVoices = new System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice>() |
bool | silence |
Properties | |
bool | isActive [get, set] |
abstract string | AudioFileExtension [get] |
abstract AudioType | AudioFileType [get] |
abstract bool | isWorkingInEditor [get] |
abstract bool | isWorkingInPlaymode [get] |
abstract int | MaxTextLength [get] |
abstract bool | isSpeakNativeSupported [get] |
abstract bool | isSpeakSupported [get] |
abstract bool | isPlatformSupported [get] |
abstract bool | isSSMLSupported [get] |
abstract bool | isOnlineService [get] |
abstract bool | hasCoRoutines [get] |
abstract bool | isIL2CPPSupported [get] |
abstract bool | hasVoicesInEditor [get] |
System.Collections.Generic.List< string > | Cultures [get] |
abstract int | MaxSimultaneousSpeeches [get] |
![]() | |
string | AudioFileExtension [get] |
Returns the extension of the generated audio files. More... | |
AudioType | AudioFileType [get] |
Returns the type 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.Voice > | Voices [get] |
Get all available voices from the current TTS-provider and fills it into a given list. More... | |
int | MaxTextLength [get] |
Maximal length of the speech text (in characters). More... | |
bool | isWorkingInEditor [get] |
Indicates if this provider is working directly inside the Unity Editor (without 'Play'-mode). More... | |
bool | isWorkingInPlaymode [get] |
Indicates if this provider is working with 'Play'-mode inside the Unity Editor. More... | |
bool | isSpeakNativeSupported [get] |
Indicates if this provider is supporting SpeakNative. More... | |
bool | isSpeakSupported [get] |
Indicates if this provider is supporting Speak. More... | |
bool | isPlatformSupported [get] |
Indicates if this provider is supporting the current platform. More... | |
bool | isSSMLSupported [get] |
Indicates if this provider is supporting SSML. More... | |
bool | isOnlineService [get] |
Indicates if this provider is an online service like MaryTTS or AWS Polly. More... | |
bool | hasCoRoutines [get] |
Indicates if this provider uses co-routines. More... | |
bool | isIL2CPPSupported [get] |
Indicates if this provider is supporting IL2CPP. More... | |
bool | hasVoicesInEditor [get] |
Indicates if this provider returns voices in the Editor mode. More... | |
System.Collections.Generic.List< string > | Cultures [get] |
Get all available cultures from the current provider (ISO 639-1). More... | |
int | MaxSimultaneousSpeeches [get] |
Maximal number of simultaneous speeches (0 = unlimited). 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 mode, Windows only). More... | |
SpeakCurrentViseme | OnSpeakCurrentViseme |
An event triggered whenever a new viseme is spoken (native mode, 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... | |
ErrorInfo | OnErrorInfo |
An event triggered whenever an error occurs. More... | |
Detailed Description
Base class for custom voice providers (TTS-systems).
Member Function Documentation
◆ Generate()
|
pure virtual |
The current provider generates an audio file from a text with a given voice.
- Parameters
-
wrapper Wrapper containing the data.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, Crosstales.RTVoice.Google.VoiceProviderGoogle, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ GenerateInEditor()
|
pure virtual |
Generates an audio file with the current provider (Editor only).
- Parameters
-
wrapper Wrapper containing the data.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ Load()
|
pure virtual |
Load the provider (e.g. all voices).
- Parameters
-
forceReload Force reload the provider (default: false, optional).
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.VoiceProviderExample, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, Crosstales.RTVoice.Google.VoiceProviderGoogle, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ Silence() [1/2]
|
virtual |
Silence all active TTS-providers.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Reimplemented in Crosstales.RTVoice.SAPI.VoiceProviderSAPI, and Crosstales.RTVoice.WebGL.VoiceProviderWebGL.
◆ Silence() [2/2]
|
virtual |
Silence the current TTS-provider (native mode).
- Parameters
-
uid UID of the speaker
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Reimplemented in Crosstales.RTVoice.SAPI.VoiceProviderSAPI.
◆ Speak()
|
pure virtual |
The current provider speaks a text with a given voice.
- Parameters
-
wrapper Wrapper containing the data.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ SpeakNative()
|
pure virtual |
The current provider speaks a text with a given voice (native mode).
- Parameters
-
wrapper Wrapper containing the data.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ SpeakNativeInEditor()
|
pure virtual |
The current provider speaks a text with a given voice (native mode & Editor only).
- Parameters
-
wrapper Wrapper containing the data.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Implemented in Crosstales.RTVoice.AWSPolly.VoiceProviderAWS, Crosstales.RTVoice.Azure.VoiceProviderAzure, Crosstales.RTVoice.Mimic.VoiceProviderMimic, Crosstales.RTVoice.MaryTTS.VoiceProviderMaryTTS, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.Google.VoiceProviderGoogle, Crosstales.RTVoice.SAPI.VoiceProviderSAPI, Crosstales.RTVoice.WebGL.VoiceProviderWebGL, and Crosstales.RTVoice.Klattersynth.VoiceProviderKlattersynth.
◆ SpeakWithClip()
|
virtual |
The provider speaks a text with a given AudioClip.
- Parameters
-
wrapper Wrapper containing the data. clip AudioClip with the speech audio.
Implements Crosstales.RTVoice.Provider.IVoiceProvider.
Event Documentation
◆ OnErrorInfo
ErrorInfo Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnErrorInfo |
An event triggered whenever an error occurs.
◆ OnSpeakAudioGenerationComplete
SpeakAudioGenerationComplete Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakAudioGenerationComplete |
An event triggered whenever a speak audio generation is completed.
◆ OnSpeakAudioGenerationStart
SpeakAudioGenerationStart Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakAudioGenerationStart |
An event triggered whenever a speak audio generation is started.
◆ OnSpeakComplete
SpeakComplete Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakComplete |
An event triggered whenever a speak is completed.
◆ OnSpeakCurrentPhoneme
SpeakCurrentPhoneme Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakCurrentPhoneme |
An event triggered whenever a new phoneme is spoken (native mode, Windows only).
◆ OnSpeakCurrentViseme
SpeakCurrentViseme Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakCurrentViseme |
An event triggered whenever a new viseme is spoken (native mode, Windows only).
◆ OnSpeakCurrentWord
SpeakCurrentWord Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakCurrentWord |
An event triggered whenever a new word is spoken (native, Windows and iOS only).
◆ OnSpeakCurrentWordString
SpeakCurrentWordString Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakCurrentWordString |
An event triggered whenever a new word is spoken (native, Windows and iOS only).
◆ OnSpeakStart
SpeakStart Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.OnSpeakStart |
An event triggered whenever a speak is started.
◆ OnVoicesReady
VoicesReady Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.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/Provider/BaseCustomVoiceProvider.cs