public class TextToSpeech extends WatsonService
InputStreamdefaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION| Constructor and Description |
|---|
TextToSpeech()
Instantiates a new text to speech.
|
TextToSpeech(java.lang.String username,
java.lang.String password)
Instantiates a new text to speech service by username and password.
|
| Modifier and Type | Method and Description |
|---|---|
ServiceCall<java.lang.Void> |
addWord(CustomVoiceModel model,
CustomTranslation translation)
Adds or updates a single custom word translation for a CustomVoiceModel.
|
ServiceCall<java.lang.Void> |
addWords(CustomVoiceModel model,
CustomTranslation... translations)
Adds or updates one or more custom word translations for a CustomVoiceModel.
|
ServiceCall<CustomVoiceModel> |
createCustomVoiceModel(java.lang.String name,
java.lang.String language,
java.lang.String description)
Creates a new CustomVoiceModel with the specified name, description, and language.
|
ServiceCall<java.lang.Void> |
deleteCustomVoiceModel(CustomVoiceModel model)
Deletes the given CustomVoiceModel.
|
ServiceCall<java.lang.Void> |
deleteWord(CustomVoiceModel model,
CustomTranslation translation)
Deletes a custom word based on a translation object.
|
ServiceCall<java.lang.Void> |
deleteWord(CustomVoiceModel model,
java.lang.String word)
Deletes a custom word based on a string.
|
ServiceCall<CustomVoiceModel> |
getCustomVoiceModel(CustomVoiceModel model)
Gets the metadata for a CustomVoiceModel specified by object.
|
ServiceCall<CustomVoiceModel> |
getCustomVoiceModel(java.lang.String customizationId)
Gets the metadata for a CustomVoiceModel specified by customization id.
|
ServiceCall<java.util.List<CustomVoiceModel>> |
getCustomVoiceModels(java.lang.String language)
Gets all meta data of the CustomVoiceModels that you own.
|
ServiceCall<Pronunciation> |
getPronunciation(java.lang.String word,
Voice voice,
Phoneme phoneme)
Returns the phonetic pronunciation for the
word specified. |
ServiceCall<Pronunciation> |
getPronunciation(java.lang.String word,
Voice voice,
Phoneme phoneme,
java.lang.String customizationId)
Returns the phonetic pronunciation for the
word specified. |
ServiceCall<Voice> |
getVoice(java.lang.String voiceName)
Lists information about the voice specified with the voice path parameter.
|
ServiceCall<Voice> |
getVoice(java.lang.String voiceName,
java.lang.String customizationId)
Lists information about the voice specified with the voice path parameter.
|
ServiceCall<java.util.List<Voice>> |
getVoices()
Lists information about all available voices.
|
ServiceCall<CustomTranslation> |
getWord(CustomVoiceModel model,
java.lang.String word)
Gets a custom word translation for the given CustomVoiceModel.
|
ServiceCall<java.util.List<CustomTranslation>> |
getWords(CustomVoiceModel model)
Gets all custom word translation for the given CustomVoiceModel.
|
ServiceCall<java.io.InputStream> |
synthesize(java.lang.String text,
Voice voice)
Synthesize text using a voice.
|
ServiceCall<java.io.InputStream> |
synthesize(java.lang.String text,
Voice voice,
AudioFormat audioFormat)
Synthesize text using a
Voice and AudioFormat. |
ServiceCall<java.io.InputStream> |
synthesize(java.lang.String text,
Voice voice,
AudioFormat audioFormat,
java.lang.String customizationId)
Synthesize text using a
Voice and AudioFormat. |
ServiceCall<java.lang.Void> |
updateCustomVoiceModel(CustomVoiceModel model)
Updates an existing CustomVoiceModel with new name, new description, and new custom word translations.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toStringpublic TextToSpeech()
public TextToSpeech(java.lang.String username,
java.lang.String password)
username - the usernamepassword - the passwordpublic ServiceCall<java.util.List<Voice>> getVoices()
getVoice(String,String) method.Voicepublic ServiceCall<Voice> getVoice(java.lang.String voiceName)
voiceName - the voice nameVoicepublic ServiceCall<Voice> getVoice(java.lang.String voiceName, java.lang.String customizationId)
customizationId parameter to obtain information
for that custom voice model of the specified voice.voiceName - the voice namecustomizationId - the customization idVoicepublic ServiceCall<Pronunciation> getPronunciation(java.lang.String word, Voice voice, Phoneme phoneme)
word specified.word - The word for which the pronunciation is requested.voice - the voice to obtain the pronunciation for the specified word in the language of that voice.phoneme - the phoneme set in which to return the pronunciationPronunciationpublic ServiceCall<Pronunciation> getPronunciation(java.lang.String word, Voice voice, Phoneme phoneme, java.lang.String customizationId)
word specified.word - The word for which the pronunciation is requested.voice - the voice to obtain the pronunciation for the specified word in the language of that voice.phoneme - the phoneme set in which to return the pronunciationcustomizationId - the customization idPronunciationpublic ServiceCall<java.io.InputStream> synthesize(java.lang.String text, Voice voice)
text - the text to synthesizevoice - the voicepublic ServiceCall<java.io.InputStream> synthesize(java.lang.String text, Voice voice, AudioFormat audioFormat)
Voice and AudioFormat.text - the textvoice - the voiceaudioFormat - the AudioFormatpublic ServiceCall<java.io.InputStream> synthesize(java.lang.String text, Voice voice, AudioFormat audioFormat, java.lang.String customizationId)
Voice and AudioFormat.text - the textvoice - the voiceaudioFormat - the AudioFormatcustomizationId - the customization IDpublic ServiceCall<java.util.List<CustomVoiceModel>> getCustomVoiceModels(java.lang.String language)
language - the language (e.g. "en-us")public ServiceCall<CustomVoiceModel> getCustomVoiceModel(CustomVoiceModel model)
model - the custom voice model object to be queriedpublic ServiceCall<CustomVoiceModel> getCustomVoiceModel(java.lang.String customizationId)
customizationId - the id of the custom voice model to be queriedpublic ServiceCall<CustomVoiceModel> createCustomVoiceModel(java.lang.String name, java.lang.String language, java.lang.String description)
name - the name of the new modellanguage - the language of the new model (the default is "en-US")description - a description of the new model (the default is no description)public ServiceCall<java.lang.Void> updateCustomVoiceModel(CustomVoiceModel model)
model - the custom voice model object to be updated with new name, description, and wordspublic ServiceCall<java.lang.Void> deleteCustomVoiceModel(CustomVoiceModel model)
model - the custom voice model object to be deletedpublic ServiceCall<java.util.List<CustomTranslation>> getWords(CustomVoiceModel model)
model - the custom voice model object from which words are to be listedpublic ServiceCall<CustomTranslation> getWord(CustomVoiceModel model, java.lang.String word)
model - the custom voice model object from which a word is to be listedword - a word from the CustomVoiceModelpublic ServiceCall<java.lang.Void> addWords(CustomVoiceModel model, CustomTranslation... translations)
model - the custom voice model object for which words are to be added or updatedtranslations - the custom translations to be added or updatedpublic ServiceCall<java.lang.Void> addWord(CustomVoiceModel model, CustomTranslation translation)
model - the custom voice model object for which a word is to be added or updatedtranslation - the translation to be added or updatedpublic ServiceCall<java.lang.Void> deleteWord(CustomVoiceModel model, CustomTranslation translation)
model - the custom voice model object from which a word is to be deletedtranslation - the translation object to be deletedpublic ServiceCall<java.lang.Void> deleteWord(CustomVoiceModel model, java.lang.String word)
model - the custom voice model object from which a word is to be deletedword - the word to be deleted