Watson Developer Cloud Unity SDK  1.0.0
The Unity SDK uses the Watson Developer Cloud services, a collection of REST APIs and SDKs that use cognitive computing to solve complex problems.
IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech Class Reference

This class wraps the Text to Speech service. Text to Speech Service More...

Inheritance diagram for IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech:
IBM.Watson.DeveloperCloud.Services.IWatsonService

Public Member Functions

 TextToSpeech (Credentials credentials)
 
delegate void GetVoicesCallback (Voices voices, string customData)
 This callback is used by the GetVoices() function. More...
 
bool GetVoices (GetVoicesCallback callback, string customData=default(string))
 Returns all available voices that can be used. More...
 
delegate void GetVoiceCallback (Voice voice, string customData)
 This callback is used by the GetVoice() function. More...
 
bool GetVoice (GetVoiceCallback callback, VoiceType?voice=null, string customData=default(string))
 Return specific voice. More...
 
delegate void ToSpeechCallback (AudioClip clip, string customData)
 This callback is passed into the ToSpeech() method. More...
 
bool ToSpeech (string text, ToSpeechCallback callback, bool usePost=false, string customData=default(string))
 Converts the given text into an AudioClip that can be played. More...
 
delegate void GetPronunciationCallback (Pronunciation pronunciation, string customData)
 This callback is used by the GetPronunciation() function. More...
 
bool GetPronunciation (GetPronunciationCallback callback, string text, VoiceType?voice=null, string format="ipa", string customization_id=default(string), string customData=default(string))
 Returns the phonetic pronunciation for the word specified by the text parameter. You can request the pronunciation for a specific format. You can also request the pronunciation for a specific voice to see the default translation for the language of that voice or for a specific custom voice model to see the translation for that voice model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void GetCustomizationsCallback (Customizations customizations, string customData)
 This callback is used by the GetCustomizations() function. More...
 
bool GetCustomizations (GetCustomizationsCallback callback, string customData=default(string))
 Lists metadata such as the name and description for the custom voice models that you own. Use the language query parameter to list the voice models that you own for the specified language only. Omit the parameter to see all voice models that you own for all languages. To see the words in addition to the metadata for a specific voice model, use the GET /v1/customizations/{customization_id} method. Only the owner of a custom voice model can use this method to list information about the model. Note: This method is currently a beta release that supports US English only More...
 
delegate void CreateCustomizationCallback (CustomizationID customizationID, string customData)
 Thid callback is used by the CreateCustomization() function. More...
 
bool CreateCustomization (CreateCustomizationCallback callback, string name, string language=default(string), string description=default(string), string customData=default(string))
 Creates a new empty custom voice model that is owned by the requesting user. Note: This method is currently a beta release that supports US English only. More...
 
delegate void OnDeleteCustomizationCallback (bool success, string customData)
 This callback is used by the DeleteCustomization() function. More...
 
bool DeleteCustomization (OnDeleteCustomizationCallback callback, string customizationID, string customData=default(string))
 Deletes the custom voice model with the specified customization_id. Only the owner of a custom voice model can use this method to delete the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void GetCustomizationCallback (Customization customization, string customData)
 This callback is used by the GetCusomization() function. More...
 
bool GetCustomization (GetCustomizationCallback callback, string customizationID, string customData=default(string))
 Lists all information about the custom voice model with the specified customization_id. In addition to metadata such as the name and description of the voice model, the output includes the words in the model and their translations as defined in the model. To see just the metadata for a voice model, use the GET /v1/customizations method. Only the owner of a custom voice model can use this method to query information about the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void UpdateCustomizationCallback (bool success, string customData)
 This callback is used by the UpdateCustomization() function. More...
 
bool UpdateCustomization (UpdateCustomizationCallback callback, string customizationID, CustomVoiceUpdate customVoiceUpdate, string customData=default(string))
 Updates information for the custom voice model with the specified customization_id. You can update the metadata such as the name and description of the voice model. You can also update the words in the model and their translations. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to update the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void GetCustomizationWordsCallback (Words words, string customData)
 This callback is used by the GetCusomizationWords() function. More...
 
bool GetCustomizationWords (GetCustomizationWordsCallback callback, string customizationID, string customData=default(string))
 Lists all of the words and their translations for the custom voice model with the specified customization_id. The output shows the translations as they are defined in the model. Only the owner of a custom voice model can use this method to query information about the model's words. Note: This method is currently a beta release that supports US English only. More...
 
delegate void AddCustomizationWordsCallback (bool success, string customData)
 This callback is used by the AddCustomizationWords() function. More...
 
bool AddCustomizationWords (AddCustomizationWordsCallback callback, string customizationID, Words words, string customData=default(string))
 Adds one or more words and their translations to the custom voice model with the specified customization_id. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add words to the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void OnDeleteCustomizationWordCallback (bool success, string customData)
 This callback is used by the DeleteCustomizationWord() function. More...
 
bool DeleteCustomizationWord (OnDeleteCustomizationWordCallback callback, string customizationID, string word, string customData=default(string))
 Deletes a single word from the custom voice model with the specified customization_id. Only the owner of a custom voice model can use this method to delete a word from the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void GetCustomizationWordCallback (Translation translation, string customData)
 This callback is used by the GetCusomizationWord() function. More...
 
bool GetCustomizationWord (GetCustomizationWordCallback callback, string customizationID, string word, string customData=default(string))
 Returns the translation for a single word from the custom model with the specified customization_id. The output shows the translation as it is defined in the model. Only the owner of a custom voice model can use this method to query information about a word from the model. Note: This method is currently a beta release that supports US English only. More...
 
delegate void AddCustomizationWordCallback (bool success, string customData)
 This callback is used by the AddCustomizationWord() function. More...
 
bool AddCustomizationWord (AddCustomizationWordCallback callback, string customizationID, string word, string translation, string customData=default(string))
 Adds a single word and its translation to the custom voice model with the specified customization_id. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add a word to the model. Note: This method is currently a beta release that supports US English only. More...
 
string GetServiceID ()
 <exclude> More...
 

Properties

AudioFormatType AudioFormat [get, set]
 This property allows the user to set the AudioFormat to use. Currently, only WAV is supported. More...
 
VoiceType Voice [get, set]
 This property allows the user to specify the voice to use. More...
 
string Url [get, set]
 Gets and sets the endpoint URL for the service. More...
 
Credentials Credentials [get, set]
 Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined. More...
 

Detailed Description

This class wraps the Text to Speech service. Text to Speech Service

Constructor & Destructor Documentation

IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.TextToSpeech ( Credentials  credentials)
inline

Member Function Documentation

bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.AddCustomizationWord ( AddCustomizationWordCallback  callback,
string  customizationID,
string  word,
string  translation,
string  customData = default(string) 
)
inline

Adds a single word and its translation to the custom voice model with the specified customization_id. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add a word to the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe identifier of the custom voice model to be updated.
wordsWords object to add to custom voice model.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.AddCustomizationWordCallback ( bool  success,
string  customData 
)

This callback is used by the AddCustomizationWord() function.

Parameters
successSuccess
dataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.AddCustomizationWords ( AddCustomizationWordsCallback  callback,
string  customizationID,
Words  words,
string  customData = default(string) 
)
inline

Adds one or more words and their translations to the custom voice model with the specified customization_id. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to add words to the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe identifier of the custom voice model to be updated.
wordsWords object to add to custom voice model.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.AddCustomizationWordsCallback ( bool  success,
string  customData 
)

This callback is used by the AddCustomizationWords() function.

Parameters
successSuccess
dataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.CreateCustomization ( CreateCustomizationCallback  callback,
string  name,
string  language = default(string),
string  description = default(string),
string  customData = default(string) 
)
inline

Creates a new empty custom voice model that is owned by the requesting user. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
nameName of the new custom voice model.
languageLanguage of the new custom voice model. Omit the parameter to use the default language, en-US. = ['de-DE', 'en-US', 'en-GB', 'es-ES', 'es-US', 'fr-FR', 'it-IT', 'ja-JP', 'pt-BR'].
descriptionDescription of the new custom voice model.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.CreateCustomizationCallback ( CustomizationID  customizationID,
string  customData 
)

Thid callback is used by the CreateCustomization() function.

Parameters
customizationIDThe customizationID.
dataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.DeleteCustomization ( OnDeleteCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Deletes the custom voice model with the specified customization_id. Only the owner of a custom voice model can use this method to delete the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe voice model to be deleted's identifier.
customDataOptional custom data.
Returns
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.DeleteCustomizationWord ( OnDeleteCustomizationWordCallback  callback,
string  customizationID,
string  word,
string  customData = default(string) 
)
inline

Deletes a single word from the custom voice model with the specified customization_id. Only the owner of a custom voice model can use this method to delete a word from the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe voice model's identifier.
wordThe word to be deleted.
customDataOptional custom data.
Returns
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomization ( GetCustomizationCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Lists all information about the custom voice model with the specified customization_id. In addition to metadata such as the name and description of the voice model, the output includes the words in the model and their translations as defined in the model. To see just the metadata for a voice model, use the GET /v1/customizations method. Only the owner of a custom voice model can use this method to query information about the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom voice model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationCallback ( Customization  customization,
string  customData 
)

This callback is used by the GetCusomization() function.

Parameters
customization
data
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizations ( GetCustomizationsCallback  callback,
string  customData = default(string) 
)
inline

Lists metadata such as the name and description for the custom voice models that you own. Use the language query parameter to list the voice models that you own for the specified language only. Omit the parameter to see all voice models that you own for all languages. To see the words in addition to the metadata for a specific voice model, use the GET /v1/customizations/{customization_id} method. Only the owner of a custom voice model can use this method to list information about the model. Note: This method is currently a beta release that supports US English only

Parameters
callbackThe callback.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationsCallback ( Customizations  customizations,
string  customData 
)

This callback is used by the GetCustomizations() function.

Parameters
customizationsThe customizations
dataOptional custom data.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationWord ( GetCustomizationWordCallback  callback,
string  customizationID,
string  word,
string  customData = default(string) 
)
inline

Returns the translation for a single word from the custom model with the specified customization_id. The output shows the translation as it is defined in the model. Only the owner of a custom voice model can use this method to query information about a word from the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom voice model's identifier.
wordThe requested word.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationWordCallback ( Translation  translation,
string  customData 
)

This callback is used by the GetCusomizationWord() function.

Parameters
translationTranslation of the requested word.
dataoptional custom data.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationWords ( GetCustomizationWordsCallback  callback,
string  customizationID,
string  customData = default(string) 
)
inline

Lists all of the words and their translations for the custom voice model with the specified customization_id. The output shows the translations as they are defined in the model. Only the owner of a custom voice model can use this method to query information about the model's words. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe requested custom voice model's identifier.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetCustomizationWordsCallback ( Words  words,
string  customData 
)

This callback is used by the GetCusomizationWords() function.

Parameters
customization
data
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetPronunciation ( GetPronunciationCallback  callback,
string  text,
VoiceType voice = null,
string  format = "ipa",
string  customization_id = default(string),
string  customData = default(string) 
)
inline

Returns the phonetic pronunciation for the word specified by the text parameter. You can request the pronunciation for a specific format. You can also request the pronunciation for a specific voice to see the default translation for the language of that voice or for a specific custom voice model to see the translation for that voice model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe GetPronunciationCallback
textThe text string to pronounce.
voiceSpecify a voice to obtain the pronunciation for the specified word in the language of that voice. All voices for the same language (for example, en-US) return the same translation. Do not specify both a voice and a customization_id. Retrieve available voices with the GET /v1/voices method. If this is null, TextToSpeech will default to the set voice.
formatSpecify the phoneme set in which to return the pronunciation. Omit the parameter to obtain the pronunciation in the default format. Either ipa or spr.
customization_idGUID of a custom voice model for which the pronunciation is to be returned. You must make the request with the service credentials of the model's owner. If the word is not defined in the specified voice model, the service returns the default translation for the model's language. Omit the parameter to see the translation for the specified voice with no customization. Do not specify both a voice and a customization_id.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetPronunciationCallback ( Pronunciation  pronunciation,
string  customData 
)

This callback is used by the GetPronunciation() function.

Parameters
pronunciationThe pronunciation strting.
string IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetServiceID ( )
inline
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetVoice ( GetVoiceCallback  callback,
VoiceType voice = null,
string  customData = default(string) 
)
inline

Return specific voice.

Parameters
callbackThe callback to invoke with the voice.
voiceThe name of the voice you would like to get. If this is null, TextToSpeech will default to the set voice.
Returns
Returns ture if the request was submitted.
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetVoiceCallback ( Voice  voice,
string  customData 
)

This callback is used by the GetVoice() function.

Parameters
voiceThe Voice object.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetVoices ( GetVoicesCallback  callback,
string  customData = default(string) 
)
inline

Returns all available voices that can be used.

Parameters
callbackThe callback to invoke with the list of available voices.
Returns
Returns ture if the request was submitted.
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.GetVoicesCallback ( Voices  voices,
string  customData 
)

This callback is used by the GetVoices() function.

Parameters
voicesThe Voices object.
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.OnDeleteCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the DeleteCustomization() function.

Parameters
success
data
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.OnDeleteCustomizationWordCallback ( bool  success,
string  customData 
)

This callback is used by the DeleteCustomizationWord() function.

Parameters
success
data
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.ToSpeech ( string  text,
ToSpeechCallback  callback,
bool  usePost = false,
string  customData = default(string) 
)
inline

Converts the given text into an AudioClip that can be played.

Parameters
textThe text to synthesis into speech.
callbackThe callback to invoke with the AudioClip.
usePostIf true, then we use post instead of get, this allows for text that exceeds the 5k limit.
Returns
Returns true if the request is sent.
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.ToSpeechCallback ( AudioClip  clip,
string  customData 
)

This callback is passed into the ToSpeech() method.

Parameters
clipThe AudioClip containing the audio to play.
bool IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.UpdateCustomization ( UpdateCustomizationCallback  callback,
string  customizationID,
CustomVoiceUpdate  customVoiceUpdate,
string  customData = default(string) 
)
inline

Updates information for the custom voice model with the specified customization_id. You can update the metadata such as the name and description of the voice model. You can also update the words in the model and their translations. A custom model can contain no more than 20,000 entries. Only the owner of a custom voice model can use this method to update the model. Note: This method is currently a beta release that supports US English only.

Parameters
callbackThe callback.
customizationIDThe identifier of the custom voice model to be updated.
customVoiceUpdateCustom voice model update data.
customDataOptional custom data.
Returns
delegate void IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.UpdateCustomizationCallback ( bool  success,
string  customData 
)

This callback is used by the UpdateCustomization() function.

Parameters
successSuccess
dataOptional custom data.

Property Documentation

AudioFormatType IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.AudioFormat
getset

This property allows the user to set the AudioFormat to use. Currently, only WAV is supported.

Credentials IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.Credentials
getset

Gets and sets the credentials of the service. Replace the default endpoint if endpoint is defined.

string IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.Url
getset

Gets and sets the endpoint URL for the service.

VoiceType IBM.Watson.DeveloperCloud.Services.TextToSpeech.v1.TextToSpeech.Voice
getset

This property allows the user to specify the voice to use.


The documentation for this class was generated from the following file: