Crosstales.RTVoice.AWSPolly.VoiceProviderAWS Class Reference

AWS Polly voice provider. More...

Inheritance diagram for Crosstales.RTVoice.AWSPolly.VoiceProviderAWS:
Crosstales.RTVoice.Provider.BaseCustomVoiceProvider Crosstales.RTVoice.Provider.IVoiceProvider

Public Member Functions

override void Load (bool forceReload=false)
 Load the provider (e.g. all voices). More...
 
override IEnumerator Generate (Crosstales.RTVoice.Model.Wrapper wrapper)
 The current provider generates an audio file from a text with a given voice. More...
 
override IEnumerator SpeakNative (Crosstales.RTVoice.Model.Wrapper wrapper)
 The current provider speaks a text with a given voice (native mode). More...
 
override IEnumerator Speak (Crosstales.RTVoice.Model.Wrapper wrapper)
 The current provider speaks a text with a given voice. More...
 
override void GenerateInEditor (Crosstales.RTVoice.Model.Wrapper wrapper)
 Generates an audio file with the current provider (Editor only). More...
 
override void SpeakNativeInEditor (Crosstales.RTVoice.Model.Wrapper wrapper)
 The current provider speaks a text with a given voice (native mode & Editor only). More...
 
- Public Member Functions inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
virtual void Silence ()
 Silence all active TTS-providers. More...
 
virtual void Silence (string uid)
 Silence the current TTS-provider (native mode). More...
 
virtual IEnumerator SpeakWithClip (Crosstales.RTVoice.Model.Wrapper wrapper, AudioClip clip)
 The provider speaks a text with a given AudioClip. More...
 

Public Attributes

override string AudioFileExtension => ".ogg"
 
override AudioType AudioFileType => AudioType.OGGVORBIS
 
override bool isWorkingInEditor => false
 
override bool isWorkingInPlaymode => true
 
override bool isPlatformSupported => !Crosstales.RTVoice.Util.Helper.isWebPlatform
 
override int MaxTextLength => 256000
 
override bool isSpeakNativeSupported => false
 
override bool isSpeakSupported => true
 
override bool isSSMLSupported => true
 
override bool isOnlineService => true
 
override bool hasCoRoutines => true
 
override bool isIL2CPPSupported => true
 
override bool hasVoicesInEditor => true
 
override int MaxSimultaneousSpeeches => 0
 
bool isValidCognitoCredentials => !string.IsNullOrEmpty(CognitoCredentials) && apiRegex.IsMatch(CognitoCredentials)
 Indicates if the Cognito Credentials are valid. More...
 
override System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoices => cachedVoices
 
bool hasNeuralVoices
 Checks if neural voices are supported on the current AWS endpoint. More...
 
- Public Attributes inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
virtual string DefaultVoiceName => string.Empty
 
virtual System.Collections.Generic.List< Crosstales.RTVoice.Model.VoiceVoices => cachedVoices
 

Protected Member Functions

override void Start ()
 
- Protected Member Functions inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
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)
 

Properties

string? CognitoCredentials [get, set]
 Cognito credentials to access AWS Polly. More...
 
string CognitoCredentials [get, set]
 
Endpoint Endpoint [get, set]
 AWS endpoint for the connection. More...
 
bool AutoBreath [get, set]
 Enables or disables the simulation of natural breathing while speaking. Ignored if neural voices are used. More...
 
SampleRate SampleRate [get, set]
 Desired sample rate in Hz. More...
 
- Properties inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
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]
 
- Properties inherited from Crosstales.RTVoice.Provider.IVoiceProvider
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.VoiceVoices [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...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
static string getValidXML (string xml)
 
- Protected Attributes inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
System.Collections.Generic.List< Crosstales.RTVoice.Model.VoicecachedVoices = new System.Collections.Generic.List<Crosstales.RTVoice.Model.Voice>()
 
bool silence
 
- Events inherited from Crosstales.RTVoice.Provider.BaseCustomVoiceProvider
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

AWS Polly voice provider.

Member Function Documentation

◆ Generate()

override IEnumerator Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.Generate ( Crosstales.RTVoice.Model.Wrapper  wrapper)
virtual

The current provider generates an audio file from a text with a given voice.

Parameters
wrapperWrapper containing the data.

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

◆ GenerateInEditor()

override void Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.GenerateInEditor ( Crosstales.RTVoice.Model.Wrapper  wrapper)
virtual

Generates an audio file with the current provider (Editor only).

Parameters
wrapperWrapper containing the data.

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

◆ Load()

override void Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.Load ( bool  forceReload = false)
virtual

Load the provider (e.g. all voices).

Parameters
forceReloadForce reload the provider (default: false, optional).

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

◆ Speak()

override IEnumerator Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.Speak ( Crosstales.RTVoice.Model.Wrapper  wrapper)
virtual

The current provider speaks a text with a given voice.

Parameters
wrapperWrapper containing the data.

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

◆ SpeakNative()

override IEnumerator Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.SpeakNative ( Crosstales.RTVoice.Model.Wrapper  wrapper)
virtual

The current provider speaks a text with a given voice (native mode).

Parameters
wrapperWrapper containing the data.

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

◆ SpeakNativeInEditor()

override void Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.SpeakNativeInEditor ( Crosstales.RTVoice.Model.Wrapper  wrapper)
virtual

The current provider speaks a text with a given voice (native mode & Editor only).

Parameters
wrapperWrapper containing the data.

Implements Crosstales.RTVoice.Provider.BaseCustomVoiceProvider.

Member Data Documentation

◆ hasNeuralVoices

bool Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.hasNeuralVoices
Initial value:
=>
endpoint == Endpoint.USEast1 ||
endpoint == Endpoint.USWest2 ||
endpoint == Endpoint.EUWest1 ||
endpoint == Endpoint.EUWest2 ||
endpoint == Endpoint.CACentral1 ||
endpoint == Endpoint.EUCentral1 ||
endpoint == Endpoint.APNortheast1 ||
endpoint == Endpoint.APSoutheast1 ||
endpoint == Endpoint.APSoutheast2

Checks if neural voices are supported on the current AWS endpoint.

Returns
True if neural voices are supported on the current AWS endpoint.

◆ isValidCognitoCredentials

bool Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.isValidCognitoCredentials => !string.IsNullOrEmpty(CognitoCredentials) && apiRegex.IsMatch(CognitoCredentials)

Indicates if the Cognito Credentials are valid.

Returns
True if the Cognito Credentials are valid.

Property Documentation

◆ AutoBreath

bool Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.AutoBreath
getset

Enables or disables the simulation of natural breathing while speaking. Ignored if neural voices are used.

◆ CognitoCredentials

string? Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.CognitoCredentials
getset

Cognito credentials to access AWS Polly.

◆ Endpoint

Endpoint Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.Endpoint
getset

AWS endpoint for the connection.

◆ SampleRate

SampleRate Crosstales.RTVoice.AWSPolly.VoiceProviderAWS.SampleRate
getset

Desired sample rate in Hz.


The documentation for this class was generated from the following file:
  • C:/Users/slaub/Unity/assets/RTVoice/RTVoicePro/Assets/Plugins/crosstales/RTVoice/3rd party/AWS Polly/Scripts/VoiceProviderAWS.cs
Endpoint Endpoint
AWS endpoint for the connection.
Definition: VoiceProviderAWS.cs:66