You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Streaming speech synthesis of the text in the body parameter. Synthesizes text to spoken audio, returning the synthesized audio stream as an array of bytes.
114
114
115
115
:param str text: The text to synthesize.
116
-
:param str accept: The requested audio format (MIME type) of the audio. You can use this header or the `accept` query parameter to specify the audio format. (For the `audio/l16` format, you can optionally specify `endianness=big-endian` or `endianness=little-endian`; the default is little endian.).
116
+
:param str accept: The type of the response: audio/basic, audio/flac, audio/l16;rate=nnnn, audio/ogg, audio/ogg;codecs=opus, audio/ogg;codecs=vorbis, audio/mp3, audio/mpeg, audio/mulaw;rate=nnnn, audio/wav, audio/webm, audio/webm;codecs=opus, or audio/webm;codecs=vorbis.
117
117
:param str voice: The voice to use for synthesis. Retrieve available voices with the `GET /v1/voices` method.
118
118
:param str customization_id: The GUID of a custom voice model to use for the synthesis. If a custom voice model is specified, it is guaranteed to work only if it matches the language of the indicated voice. You must make the request with service credentials created for the instance of the service that owns the custom model. Omit the parameter to use the specified voice with no customization.
119
119
:return: A `Response <Response>` object representing the response.
Lists all information about the custom voice model with the specified
240
240
`customization_id`. In addition to metadata such as the name and description of
241
241
the voice model, the output includes the words in the model and their translations
242
-
as defined in the model. **Note:** This method is currently a beta release.
242
+
as defined in the model. To see just the metadata for a voice model, use the `GET
243
+
/v1/customizations` method. You must use credentials for the instance of the
244
+
service that owns a model to list information about it. **Note:** This method is
245
+
currently a beta release.
243
246
244
247
:param str customization_id: The GUID of the custom voice model that is to be queried. You must make the request with service credentials created for the instance of the service that owns the custom model.
245
248
:return: A `dict` containing the `VoiceModel` response.
Lists all available custom voice models for a language or for all languages.
262
-
**Note:** This method is currently a beta release.
264
+
Lists metadata such as the name and description for the custom voice models that
265
+
you own. Use the `language` query parameter to list the voice models that you own
266
+
for the specified language only. Omit the parameter to see all voice models that
267
+
you own for all languages. To see the words in addition to the metadata for a
268
+
specific voice model, use the `GET /v1/customizations/{customization_id}` method.
269
+
You must use credentials for the instance of the service that owns a model to list
270
+
information about it. **Note:** This method is currently a beta release.
263
271
264
272
:param str language: The language for which custom voice models that are owned by the requesting service credentials are to be returned. Omit the parameter to see all custom voice models that are owned by the requester.
265
273
:return: A `dict` containing the `VoiceModels` response.
:param str customization_id: The GUID of the custom voice model that is to be updated. You must make the request with service credentials created for the instance of the service that owns the custom model.
296
304
:param str name: A new name for the custom voice model.
297
305
:param str description: A new description for the custom voice model.
298
-
:param list[CustomWord] words: An array of words and their translations that are to be added or updated for the custom voice model. Pass an empty array to make no additions or updates.
306
+
:param list[Word] words: An array of words and their translations that are to be added or updated for the custom voice model. Pass an empty array to make no additions or updates.
299
307
:rtype: None
300
308
"""
301
309
ifcustomization_idisNone:
302
310
raiseValueError('customization_id must be provided')
:param str customization_id: The GUID of the custom voice model that is to be updated. You must make the request with service credentials created for the instance of the service that owns the custom model.
366
-
:param list[CustomWord] words: An array of `CustomWord` objects that provides information about the words and their translations that are to be added or updated for the custom voice model.
374
+
:param list[Word] words: An array of words and their translations from the custom voice model. The words are listed in alphabetical order, with uppercase letters listed before lowercase letters. The array is empty if the custom model contains no words.
367
375
:rtype: None
368
376
"""
369
377
ifcustomization_idisNone:
370
378
raiseValueError('customization_id must be provided')
:attr str word: A word that is to be added or updated for the custom voice model.
473
-
:attr str translation: The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for representing the phonetic string of a word either as an IPA or IBM SPR translation. A sounds-like translation consists of one or more words that, when combined, sound like the word.
474
-
:attr str part_of_speech: (optional) **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://console.bluemix.net/docs/services/text-to-speech/custom-rules.html#jaNotes).
475
-
"""
476
-
477
-
def__init__(self, word, translation, part_of_speech=None):
478
-
"""
479
-
Initialize a CustomWord object.
480
-
481
-
:param str word: A word that is to be added or updated for the custom voice model.
482
-
:param str translation: The phonetic or sounds-like translation for the word. A phonetic translation is based on the SSML format for representing the phonetic string of a word either as an IPA or IBM SPR translation. A sounds-like translation consists of one or more words that, when combined, sound like the word.
483
-
:param str part_of_speech: (optional) **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://console.bluemix.net/docs/services/text-to-speech/custom-rules.html#jaNotes).
484
-
"""
485
-
self.word=word
486
-
self.translation=translation
487
-
self.part_of_speech=part_of_speech
488
-
489
-
@classmethod
490
-
def_from_dict(cls, _dict):
491
-
"""Initialize a CustomWord object from a json dictionary."""
492
-
args= {}
493
-
if'word'in_dict:
494
-
args['word'] =_dict['word']
495
-
else:
496
-
raiseValueError(
497
-
'Required property \'word\' not present in CustomWord JSON')
498
-
if'translation'in_dict:
499
-
args['translation'] =_dict['translation']
500
-
else:
501
-
raiseValueError(
502
-
'Required property \'translation\' not present in CustomWord JSON'
503
-
)
504
-
if'part_of_speech'in_dict:
505
-
args['part_of_speech'] =_dict['part_of_speech']
506
-
returncls(**args)
507
-
508
-
def_to_dict(self):
509
-
"""Return a json dictionary representing this model."""
0 commit comments