Events
: TTSServiceEvents |
Signature
TTSServiceEvents Meta.WitAi.TTS.TTSService.Events |
AudioSystem
: IAudioSystem
[Get][Set] |
Audio system to be used for obtaining audio clip streams
Signature
IAudioSystem Meta.WitAi.TTS.TTSService.AudioSystem |
DiskCacheHandler
: ITTSDiskCacheHandler
[Get][Set] |
Disk cache that assists with the backup and retrieval of audio clips saved to disk.
Signature
ITTSDiskCacheHandler Meta.WitAi.TTS.TTSService.DiskCacheHandler |
Instance
: TTSService
[Get] |
Static singleton to be used when interacting with a single TTSService
Signature
TTSService Meta.WitAi.TTS.TTSService.Instance |
Logger
: IVLogger
[Get] |
Signature
IVLogger Meta.WitAi.TTS.TTSService.Logger |
RuntimeCacheHandler
: ITTSRuntimeCacheHandler
[Get][Set] |
Runtime cache that assists with the temporary storage of audio clips
Signature
ITTSRuntimeCacheHandler Meta.WitAi.TTS.TTSService.RuntimeCacheHandler |
VoiceProvider
: abstract ITTSVoiceProvider
[Get] |
Signature
abstract ITTSVoiceProvider Meta.WitAi.TTS.TTSService.VoiceProvider |
WebHandler
: abstract ITTSWebHandler
[Get] |
Signature
abstract ITTSWebHandler Meta.WitAi.TTS.TTSService.WebHandler |
OnServiceDestroy
: Action< TTSService > |
Static event called whenever any TTSService.OnDestroy is called
Signature
Action<TTSService> Meta.WitAi.TTS.TTSService.OnServiceDestroy |
OnServiceStart
: Action< TTSService > |
Static event called whenever any TTSService.Awake is called
Signature
Action<TTSService> Meta.WitAi.TTS.TTSService.OnServiceStart |
Awake
()
|
Signature
virtual void Meta.WitAi.TTS.TTSService.Awake() Returns void |
GetClipIDWithFinalText
(
formattedText
, voiceSettings
)
|
Obtain unique id for clip data with text that has already been passed through GetFinalText
Signature
virtual string Meta.WitAi.TTS.TTSService.GetClipIDWithFinalText(string formattedText, TTSVoiceSettings voiceSettings) Parameters formattedText: stringvoiceSettings: TTSVoiceSettingsReturns string |
GetInterface< TInterface >
(
current
)
|
Obtains a script implementing a specific interface on this game object
Signature
TInterface Meta.WitAi.TTS.TTSService.GetInterface< TInterface >(TInterface current) Parameters current: TInterfaceReturns TInterface |
GetOrCreateInterface< TInterface, TDefault >
(
current
)
|
Obtains a script implementing an interface or generates one if not found.
Signature
TInterface Meta.WitAi.TTS.TTSService.GetOrCreateInterface< TInterface, TDefault >(TInterface current) Parameters current: TInterfaceReturns TInterface |
OnDestroy
()
|
Signature
virtual void Meta.WitAi.TTS.TTSService.OnDestroy() Returns void |
OnDisable
()
|
Signature
virtual void Meta.WitAi.TTS.TTSService.OnDisable() Returns void |
OnEnable
()
|
Signature
virtual void Meta.WitAi.TTS.TTSService.OnEnable() Returns void |
OnRuntimeClipAdded
(
clipData
)
|
Called when runtime cache adds a clip
Signature
virtual void Meta.WitAi.TTS.TTSService.OnRuntimeClipAdded(TTSClipData clipData) Parameters clipData: TTSClipDataReturns void |
OnRuntimeClipRemoved
(
clipData
)
|
Called when runtime cache unloads a clip
Signature
virtual void Meta.WitAi.TTS.TTSService.OnRuntimeClipRemoved(TTSClipData clipData) Parameters Returns void |
SetClipLoadState
(
clipData
, loadState
)
|
Signature
virtual void Meta.WitAi.TTS.TTSService.SetClipLoadState(TTSClipData clipData, TTSClipLoadState loadState) Parameters clipData: TTSClipDataloadState: TTSClipLoadStateReturns void |
SetListeners
(
add
)
|
Sets listeners to add or remove
Signature
virtual void Meta.WitAi.TTS.TTSService.SetListeners(bool add) Parameters add: boolReturns void |
Start
()
|
Signature
virtual void Meta.WitAi.TTS.TTSService.Start() Returns void |
DecodeTts
(
responseNode
, textToSpeak
, voiceSettings
)
|
Decode a response node into text to be spoken or a specific voice setting
Signature
bool Meta.WitAi.TTS.TTSService.DecodeTts(WitResponseNode responseNode, out string textToSpeak, out TTSVoiceSettings voiceSettings) Parameters textToSpeak: out string
The text to be spoken output
Returns bool
True if decode was successful
|
DownloadAsync
(
textToSpeak
, voiceSettings
, diskCacheSettings
)
|
Perform a download for a TTS audio clip
Signature
async Task<string> Meta.WitAi.TTS.TTSService.DownloadAsync(string textToSpeak, TTSVoiceSettings voiceSettings, TTSDiskCacheSettings diskCacheSettings) Parameters textToSpeak: string
Text to be spoken in clip
Returns async Task< string >
Any errors that occured during the download process
|
DownloadToDiskCache
(
textToSpeak
, presetVoiceId
, diskCacheSettings
, onDownloadComplete
)
|
Perform a download for a TTS audio clip
Signature
TTSClipData Meta.WitAi.TTS.TTSService.DownloadToDiskCache(string textToSpeak, string presetVoiceId, TTSDiskCacheSettings diskCacheSettings=null, Action< TTSClipData, string, string > onDownloadComplete=null) Parameters textToSpeak: string
Text to be spoken in clip
presetVoiceId: string
Specific voice id
onDownloadComplete: Action< TTSClipData, string, string >
Callback when file has finished downloading
|
DownloadToDiskCache
(
textToSpeak
, voiceSettings
, diskCacheSettings
, onDownloadComplete
)
|
Perform a download for a TTS audio clip
Signature
TTSClipData Meta.WitAi.TTS.TTSService.DownloadToDiskCache(string textToSpeak, TTSVoiceSettings voiceSettings, TTSDiskCacheSettings diskCacheSettings=null, Action< TTSClipData, string, string > onDownloadComplete=null) Parameters textToSpeak: string
Text to be spoken in clip
onDownloadComplete: Action< TTSClipData, string, string >
Callback when file has finished downloading with success or error
|
GetAllPresetVoiceSettings
()
|
Return all preset voice settings
Signature
TTSVoiceSettings [] Meta.WitAi.TTS.TTSService.GetAllPresetVoiceSettings() Returns TTSVoiceSettings [] |
GetAllRuntimeCachedClips
()
|
Obtain all clips from the runtime cache, if applicable
Signature
TTSClipData [] Meta.WitAi.TTS.TTSService.GetAllRuntimeCachedClips() Returns TTSClipData [] |
GetClipData
(
textToSpeak
, voiceSettings
, diskCacheSettings
)
|
Creates new clip data or returns existing cached clip
Signature
TTSClipData Meta.WitAi.TTS.TTSService.GetClipData(string textToSpeak, TTSVoiceSettings voiceSettings, TTSDiskCacheSettings diskCacheSettings) Parameters textToSpeak: string
Text to speak
|
GetClipID
(
textToSpeak
, voiceSettings
)
|
Obtain unique id for clip data using provided text
Signature
string Meta.WitAi.TTS.TTSService.GetClipID(string textToSpeak, TTSVoiceSettings voiceSettings) Parameters textToSpeak: stringvoiceSettings: TTSVoiceSettingsReturns string |
GetDiskCachePath
(
textToSpeak
, clipID
, voiceSettings
, diskCacheSettings
)
|
Get disk cache
Signature
string Meta.WitAi.TTS.TTSService.GetDiskCachePath(string textToSpeak, string clipID, TTSVoiceSettings voiceSettings, TTSDiskCacheSettings diskCacheSettings) Parameters textToSpeak: string
Text to be spoken in clip
clipID: string
Unique clip id
Returns string |
GetFinalText
(
textToSpeak
, voiceSettings
)
|
Gets the text to be spoken after applying all relevant voice settings.
Signature
virtual string Meta.WitAi.TTS.TTSService.GetFinalText(string textToSpeak, TTSVoiceSettings voiceSettings) Parameters textToSpeak: string
Text to be spoken by a particular voice
Returns string
Returns a the final text to be spoken
|
GetInvalidError
()
|
Returns error if invalid
Signature
virtual string Meta.WitAi.TTS.TTSService.GetInvalidError() Returns string |
GetPresetVoiceSettings
(
presetVoiceId
)
|
Return preset voice settings for a specific id
Signature
TTSVoiceSettings Meta.WitAi.TTS.TTSService.GetPresetVoiceSettings(string presetVoiceId) Parameters presetVoiceId: stringReturns TTSVoiceSettings |
GetRuntimeCachedClip
(
clipID
)
|
Obtain a clip from the runtime cache, if applicable
Signature
TTSClipData Meta.WitAi.TTS.TTSService.GetRuntimeCachedClip(string clipID) Parameters clipID: stringReturns TTSClipData |
Load
(
textToSpeak
, presetVoiceId
, diskCacheSettings
, onStreamReady
, onStreamComplete
)
|
Loads a text-to-speech clip using a preset voice id, specified settings and return methods
Signature
TTSClipData Meta.WitAi.TTS.TTSService.Load(string textToSpeak, string presetVoiceId=null, TTSDiskCacheSettings diskCacheSettings=null, Action< TTSClipData > onStreamReady=null, Action< TTSClipData, string > onStreamComplete=null) Parameters textToSpeak: string
Text to be spoken in audio
presetVoiceId: string
Specific id that corresponds to a preset voice setting id
|
Load
(
textToSpeak
, voiceSettings
, diskCacheSettings
, onStreamReady
, onStreamComplete
)
|
Loads a text-to-speech clip using specified settings and return methods
Signature
TTSClipData Meta.WitAi.TTS.TTSService.Load(string textToSpeak, TTSVoiceSettings voiceSettings, TTSDiskCacheSettings diskCacheSettings=null, Action< TTSClipData > onStreamReady=null, Action< TTSClipData, string > onStreamComplete=null) Parameters textToSpeak: string
Text to be spoken in audio
|
LoadAsync
(
clipData
, onStreamReady
, onStreamComplete
)
|
Loads a text-to-speech clip using specified settings and return methods
Signature
async Task<string> Meta.WitAi.TTS.TTSService.LoadAsync(TTSClipData clipData, Action< TTSClipData > onStreamReady=null, Action< TTSClipData, string > onStreamComplete=null) Parameters Returns async Task< string >
Returns an error
|
ShouldCacheToDisk
(
clipData
)
|
Whether a specific clip should be cached
Signature
bool Meta.WitAi.TTS.TTSService.ShouldCacheToDisk(TTSClipData clipData) Parameters Returns bool
True if should be cached
|
Unload
(
clipData
)
|
Force a runtime cache unload
Signature
void Meta.WitAi.TTS.TTSService.Unload(TTSClipData clipData) Parameters clipData: TTSClipDataReturns void |
UnloadAll
()
|
Unload all audio clips from the runtime cache
Signature
void Meta.WitAi.TTS.TTSService.UnloadAll() Returns void |