public class TextToSpeech extends WatsonService
<phoneme alphabet="ipa" ph="təmˈɑto"></phoneme>
or in the proprietary IBM Symbolic Phonetic Representation (SPR)
<phoneme alphabet="ibm" ph="1gAstroEntxrYFXs"></phoneme>
See [Understanding customization](https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html).
* **WebSocket interface:** The service also offers a WebSocket interface for speech synthesis. The WebSocket
interface supports both plain text and SSML input, including the SSML <mark> element and word timings. See [The
WebSocket interface](https://console.bluemix.net/docs/services/text-to-speech/websockets.html).
* **Customization IDs:** Many methods accept a customization ID, which is a Globally Unique Identifier (GUID).
Customization IDs are hexadecimal strings that have the format `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`.
* **`X-Watson-Learning-Opt-Out`:** By default, all Watson services log requests and their results. Logging is done
only to improve the services for future users. The logged data is not shared or made public. To prevent IBM from
accessing your data for general service improvements, set the `X-Watson-Learning-Opt-Out` request header to `true`
for all requests. You must set the header on each request that you do not want IBM to access for general service
improvements.
Methods of the customization interface do not log words and translations that you use to build custom voice models.
Your training data is never used to improve the service's base models. However, the service does log such data when a
custom model is used with a synthesize request. You must set the `X-Watson-Learning-Opt-Out` request header to `true`
to prevent IBM from accessing the data to improve the service.
* **`X-Watson-Metadata`:** This header allows you to associate a customer ID with data that is passed with a request.
If necessary, you can use the **Delete labeled data** method to delete the data for a customer ID. See [Information
security](https://console.bluemix.net/docs/services/text-to-speech/information-security.html).defaultHeaders, JSON_MIME_PATTERN, JSON_PATCH_MIME_PATTERN, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
TextToSpeech()
Instantiates a new `TextToSpeech`.
|
TextToSpeech(IamOptions iamOptions)
Instantiates a new `TextToSpeech` with IAM.
|
TextToSpeech(java.lang.String username,
java.lang.String password)
Instantiates a new `TextToSpeech` with username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<java.lang.Void> |
addWord(AddWordOptions addWordOptions)
Add a custom word.
|
ServiceCall<java.lang.Void> |
addWords(AddWordsOptions addWordsOptions)
Add custom words.
|
ServiceCall<VoiceModel> |
createVoiceModel(CreateVoiceModelOptions createVoiceModelOptions)
Create a custom model.
|
ServiceCall<java.lang.Void> |
deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
Delete labeled data.
|
ServiceCall<java.lang.Void> |
deleteVoiceModel(DeleteVoiceModelOptions deleteVoiceModelOptions)
Delete a custom model.
|
ServiceCall<java.lang.Void> |
deleteWord(DeleteWordOptions deleteWordOptions)
Delete a custom word.
|
ServiceCall<Pronunciation> |
getPronunciation(GetPronunciationOptions getPronunciationOptions)
Get pronunciation.
|
ServiceCall<Voice> |
getVoice(GetVoiceOptions getVoiceOptions)
Get a voice.
|
ServiceCall<VoiceModel> |
getVoiceModel(GetVoiceModelOptions getVoiceModelOptions)
Get a custom model.
|
ServiceCall<Translation> |
getWord(GetWordOptions getWordOptions)
Get a custom word.
|
ServiceCall<VoiceModels> |
listVoiceModels()
List custom models.
|
ServiceCall<VoiceModels> |
listVoiceModels(ListVoiceModelsOptions listVoiceModelsOptions)
List custom models.
|
ServiceCall<Voices> |
listVoices()
List voices.
|
ServiceCall<Voices> |
listVoices(ListVoicesOptions listVoicesOptions)
List voices.
|
ServiceCall<Words> |
listWords(ListWordsOptions listWordsOptions)
List custom words.
|
ServiceCall<java.io.InputStream> |
synthesize(SynthesizeOptions synthesizeOptions)
Synthesize audio.
|
ServiceCall<java.lang.Void> |
updateVoiceModel(UpdateVoiceModelOptions updateVoiceModelOptions)
Update a custom model.
|
configureClient, configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getPassword, getToken, getUsername, isJsonMimeType, isJsonPatchMimeType, isTokenManagerSet, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setIamCredentials, setSkipAuthentication, setUsernameAndPassword, toString
public TextToSpeech()
public TextToSpeech(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the passwordpublic TextToSpeech(IamOptions iamOptions)
iamOptions
- the options for authenticating through IAMpublic ServiceCall<Voice> getVoice(GetVoiceOptions getVoiceOptions)
getVoiceOptions
- the GetVoiceOptions
containing the options for the callServiceCall
with a response type of Voice
public ServiceCall<Voices> listVoices(ListVoicesOptions listVoicesOptions)
listVoicesOptions
- the ListVoicesOptions
containing the options for the callServiceCall
with a response type of Voices
public ServiceCall<Voices> listVoices()
ServiceCall
with a response type of Voices
public ServiceCall<java.io.InputStream> synthesize(SynthesizeOptions synthesizeOptions)
synthesizeOptions
- the SynthesizeOptions
containing the options for the callServiceCall
with a response type of InputStream
public ServiceCall<Pronunciation> getPronunciation(GetPronunciationOptions getPronunciationOptions)
getPronunciationOptions
- the GetPronunciationOptions
containing the options for the callServiceCall
with a response type of Pronunciation
public ServiceCall<VoiceModel> createVoiceModel(CreateVoiceModelOptions createVoiceModelOptions)
createVoiceModelOptions
- the CreateVoiceModelOptions
containing the options for the callServiceCall
with a response type of VoiceModel
public ServiceCall<java.lang.Void> deleteVoiceModel(DeleteVoiceModelOptions deleteVoiceModelOptions)
deleteVoiceModelOptions
- the DeleteVoiceModelOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<VoiceModel> getVoiceModel(GetVoiceModelOptions getVoiceModelOptions)
getVoiceModelOptions
- the GetVoiceModelOptions
containing the options for the callServiceCall
with a response type of VoiceModel
public ServiceCall<VoiceModels> listVoiceModels(ListVoiceModelsOptions listVoiceModelsOptions)
listVoiceModelsOptions
- the ListVoiceModelsOptions
containing the options for the callServiceCall
with a response type of VoiceModels
public ServiceCall<VoiceModels> listVoiceModels()
ServiceCall
with a response type of VoiceModels
public ServiceCall<java.lang.Void> updateVoiceModel(UpdateVoiceModelOptions updateVoiceModelOptions)
updateVoiceModelOptions
- the UpdateVoiceModelOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<java.lang.Void> addWord(AddWordOptions addWordOptions)
addWordOptions
- the AddWordOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<java.lang.Void> addWords(AddWordsOptions addWordsOptions)
addWordsOptions
- the AddWordsOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<java.lang.Void> deleteWord(DeleteWordOptions deleteWordOptions)
deleteWordOptions
- the DeleteWordOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<Translation> getWord(GetWordOptions getWordOptions)
getWordOptions
- the GetWordOptions
containing the options for the callServiceCall
with a response type of Translation
public ServiceCall<Words> listWords(ListWordsOptions listWordsOptions)
listWordsOptions
- the ListWordsOptions
containing the options for the callServiceCall
with a response type of Words
public ServiceCall<java.lang.Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
deleteUserDataOptions
- the DeleteUserDataOptions
containing the options for the callServiceCall
with a response type of Void