API reference
API reference
Select your platform
No SDKs available
No versions available

TTSSpeaker Class

Properties

IVLogger Logger[Get]
TTSService TTSService[Get]
string VoiceID[Get]
The voice settings to be used for this TTSSpeaker
Whether any queued clips are still not ready for playback
List< TTSClipData > QueuedClips[Get]
The script used to perform audio playback of IAudioClipStreams.
  1. Gets IAudioPlayer component if applied to this speaker
  2. If no IAudioPlayer component is found, the TTSService's audio system will be used to generate an audio player.
  3. If still not found, adds a UnityAudioPlayer.
AudioSource AudioSource[Get]
Whether playback is currently paused or not
The current amount of elapsed samples of the playing audio data if applicable
The callback following the change of the current sample
The callback following a tts event update

Fields

TTSSpeakerEvents Events[Get]
VoiceSpeechEvents SpeechEvents[Get]
string PrependedText[Get]
string AppendedText[Get]
TTSWitVoiceSettings customWitVoiceSettings[Get]
Whether a clip is currently playing for this speaker
The data for the currently playing clip
Whether there are any clips in the loading queue
Whether the speaker currently has currently speaking clip or a playback queue
The total samples available for the current tts events
The current tts events available

Protected Functions

virtual void Start ( )
virtual void OnDestroy ( )
virtual void OnEnable ( )
virtual void OnDisable ( )
virtual void HandleClipUnload
( TTSClipData clipData )
virtual bool IsPlaybackComplete ( )
virtual void HandlePlaybackComplete
( bool stopped )
virtual void SetPause
( bool toPaused )
virtual void RaiseOnPlaybackQueueBegin ( )
virtual void RaiseOnPlaybackQueueComplete ( )
Updates callback sample
Updates event callback

Member Functions

Gets final text following prepending/appending and any special formatting
Parameters
textToSpeak
The base text to be spoken
Returns
Returns an array of split texts to be spoken
Obtain final text list from format and text list
Parameters
format
The format to be used
textsToSpeak
The array of strings to be inserted into the format
Returns
Returns a list of formatted texts
Formats text using an initial format string parameter and additional text items to be inserted into the format
Parameters
format
The format to be used
textsToSpeak
The array of strings to be inserted into the format
Returns
A formatted text string
Load a tts clip using the specified text, disk cache settings and playback events. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and playback events. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and disk cache settings. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
Loads a formated phrase to be spoken. Cancels all previous clips when loaded and then plays.
Parameters
format
Format string to be filled in with texts
textsToSpeak
Texts to be inserted into the formatter
Load a tts clip using the specified text, disk cache settings and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and disk cache settings and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
Load a tts clip using the specified text, disk cache settings and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and disk cache settings and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
textToSpeak
The text to be spoken
Load a tts clip using the specified response node and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text, disk cache settings and playback events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and playback events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textToSpeak
The text to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and disk cache settings events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textToSpeak
The text to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textToSpeak
The text to be spoken
Loads a formated phrase to be spoken. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
format
Format string to be filled in with texts
textsToSpeak
Texts to be inserted into the formatter
Load a tts clip using the specified text phrases, disk cache settings and playback events and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and playback events and then waits for the files to load & play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and disk cache settings and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text phrases and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
Load a tts clip using the specified text phrases, disk cache settings and playback events and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and playback events and then waits for the files to load & play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and disk cache settings and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text phrases and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
textsToSpeak
Multiple texts to be spoken
Set a voice override for future requests
Parameters
overrideVoiceSettings
The settings to be applied to upcoming requests
Clears the current voice override
Load a tts clip using the specified response node, disk cache settings and playback events. Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified response node and disk cache settings Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified response node and playback events Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified response node and playback events Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text, disk cache settings and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and playback events and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text and disk cache settings and then waits for the file to load and play. Cancels all previous clips when loaded and then plays.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text, disk cache settings and playback events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text and playback events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text and disk cache settings events. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
Returns
True if responseNode is decoded successfully
Load a tts clip using the specified text phrases, disk cache settings and playback events and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and playback events and then waits for the files to load & play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and disk cache settings and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text phrases and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
Load a tts clip using the specified text phrases, disk cache settings and playback events and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and playback events and then waits for the files to load & play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
playbackEvents
Events to be called for this specific tts playback request
Load a tts clip using the specified text phrases and disk cache settings and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
diskCacheSettings
Specific tts load caching settings
Load a tts clip using the specified text phrases and then waits for the files to load and play. Adds clip to playback queue and will speak once queue has completed all playback.
Parameters
responseNode
Parsed data that includes text to be spoken and voice settings
Stop load and playback of a specific clip
Parameters
textToSpeak
Stop a specific text phrase
allInstances
Whether to remove the first instance of this clip or all instances
Stop load and playback of a specific clip
Parameters
clipData
The clip to be stopped and removed from the queue
allInstances
Whether to remove the first instance of this clip or all instances
Abort loading of all items in the load queue
Stop playback of currently played audio clip
Stops loading and playback immediately
Pause any current or future loaded audio playback
Resume playback for current and future audio clips
Call before sending speech data to warm up system
Call at the start of a larger text block to indicate many queued requests will be coming
Call at the end of a larger text block to indicate a block of text is complete.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon