|
15 | 15 | # limitations under the License. |
16 | 16 | """ |
17 | 17 | ### Service Overview |
18 | | -The IBM® Text to Speech service provides an API that uses IBM's speech-synthesis |
| 18 | +The IBM® Text to Speech service provides APIs that use IBM's speech-synthesis |
19 | 19 | capabilities to synthesize text into natural-sounding speech in a variety of languages, |
20 | 20 | dialects, and voices. The service supports at least one male or female voice, sometimes |
21 | | -both, for each language. The audio is streamed back to the client with minimal delay. For |
22 | | -more information about the service, see the [IBM® Cloud |
23 | | -documentation](https://console.bluemix.net/docs/services/text-to-speech/index.html). |
24 | | -### API usage guidelines |
25 | | -* **Audio formats:** The service can produce audio in many formats (MIME types). See |
26 | | -[Specifying an audio |
27 | | -format](https://console.bluemix.net/docs/services/text-to-speech/http.html#format). |
28 | | -* **SSML:** Many methods refer to the Speech Synthesis Markup Language (SSML). SSML is an |
| 21 | +both, for each language. The audio is streamed back to the client with minimal delay. |
| 22 | +For speech synthesis, the service supports a synchronous HTTP Representational State |
| 23 | +Transfer (REST) interface. It also supports a WebSocket interface that provides both plain |
| 24 | +text and SSML input, including the SSML <mark> element and word timings. SSML is an |
29 | 25 | XML-based markup language that provides text annotation for speech-synthesis applications. |
30 | | -See [Using SSML](https://console.bluemix.net/docs/services/text-to-speech/SSML.html) and |
31 | | -[Using IBM SPR](https://console.bluemix.net/docs/services/text-to-speech/SPRs.html). |
32 | | -* **Word translations:** Many customization methods accept sounds-like or phonetic |
33 | | -translations for words. Phonetic translations are based on the SSML phoneme format for |
34 | | -representing a word. You can specify them in standard International Phonetic Alphabet |
35 | | -(IPA) representation |
36 | | - <phoneme alphabet="ipa" ph="təmˈɑto"></phoneme> |
37 | | - or in the proprietary IBM Symbolic Phonetic Representation (SPR) |
38 | | - <phoneme alphabet="ibm" ph="1gAstroEntxrYFXs"></phoneme> |
39 | | - See [Understanding |
40 | | -customization](https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html). |
41 | | -* **WebSocket interface:** The service also offers a WebSocket interface for speech |
42 | | -synthesis. The WebSocket interface supports both plain text and SSML input, including the |
43 | | -SSML <mark> element and word timings. See [The WebSocket |
44 | | -interface](https://console.bluemix.net/docs/services/text-to-speech/websockets.html). |
45 | | -* **Customization IDs:** Many methods accept a customization ID, which is a Globally |
46 | | -Unique Identifier (GUID). Customization IDs are hexadecimal strings that have the format |
47 | | -`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`. |
48 | | -* **`X-Watson-Learning-Opt-Out`:** By default, all Watson services log requests and their |
49 | | -results. Logging is done only to improve the services for future users. The logged data is |
50 | | -not shared or made public. To prevent IBM from accessing your data for general service |
51 | | -improvements, set the `X-Watson-Learning-Opt-Out` request header to `true` for all |
52 | | -requests. You must set the header on each request that you do not want IBM to access for |
53 | | -general service improvements. |
54 | | - Methods of the customization interface do not log words and translations that you use to |
55 | | -build custom voice models. Your training data is never used to improve the service's base |
56 | | -models. However, the service does log such data when a custom model is used with a |
57 | | -synthesize request. You must set the `X-Watson-Learning-Opt-Out` request header to `true` |
58 | | -to prevent IBM from accessing the data to improve the service. |
59 | | -* **`X-Watson-Metadata`:** This header allows you to associate a customer ID with data |
60 | | -that is passed with a request. If necessary, you can use the **Delete labeled data** |
61 | | -method to delete the data for a customer ID. See [Information |
62 | | -security](https://console.bluemix.net/docs/services/text-to-speech/information-security.html). |
| 26 | +The service also offers a customization interface. You can use the interface to define |
| 27 | +sounds-like or phonetic translations for words. A sounds-like translation consists of one |
| 28 | +or more words that, when combined, sound like the word. A phonetic translation is based on |
| 29 | +the SSML phoneme format for representing a word. You can specify a phonetic translation in |
| 30 | +standard International Phonetic Alphabet (IPA) representation or in the proprietary IBM |
| 31 | +Symbolic Phonetic Representation (SPR). |
63 | 32 | """ |
64 | 33 |
|
65 | 34 | from __future__ import absolute_import |
@@ -141,6 +110,8 @@ def get_voice(self, voice, customization_id=None, **kwargs): |
141 | 110 | language, gender, and other details about the voice. Specify a customization ID to |
142 | 111 | obtain information for that custom voice model of the specified voice. To list |
143 | 112 | information about all available voices, use the **List voices** method. |
| 113 | + **See also:** [Specifying a |
| 114 | + voice](https://console.bluemix.net/docs/services/text-to-speech/http.html#voices). |
144 | 115 |
|
145 | 116 | :param str voice: The voice for which information is to be returned. |
146 | 117 | :param str customization_id: The customization ID (GUID) of a custom voice model |
@@ -174,6 +145,8 @@ def list_voices(self, **kwargs): |
174 | 145 | Lists all voices available for use with the service. The information includes the |
175 | 146 | name, language, gender, and other details about the voice. To see information |
176 | 147 | about a specific voice, use the **Get a voice** method. |
| 148 | + **See also:** [Specifying a |
| 149 | + voice](https://console.bluemix.net/docs/services/text-to-speech/http.html#voices). |
177 | 150 |
|
178 | 151 | :param dict headers: A `dict` containing the request headers |
179 | 152 | :return: A `DetailedResponse` containing the result, headers and HTTP status code. |
@@ -203,16 +176,15 @@ def synthesize(self, |
203 | 176 | Synthesizes text to spoken audio, returning the synthesized audio stream as an |
204 | 177 | array of bytes. You can pass a maximum of 5 KB of text. Use the `Accept` header |
205 | 178 | or the `accept` query parameter to specify the requested format (MIME type) of the |
206 | | - response audio. By default, the service uses `audio/ogg;codecs=opus`. For detailed |
207 | | - information about the supported audio formats and sampling rates, see [Specifying |
208 | | - an audio |
209 | | - format](https://console.bluemix.net/docs/services/text-to-speech/http.html#format). |
| 179 | + response audio. By default, the service uses `audio/ogg;codecs=opus`. |
210 | 180 | If a request includes invalid query parameters, the service returns a `Warnings` |
211 | 181 | response header that provides messages about the invalid parameters. The warning |
212 | 182 | includes a descriptive message and a list of invalid argument strings. For |
213 | 183 | example, a message such as `\"Unknown arguments:\"` or `\"Unknown url query |
214 | 184 | arguments:\"` followed by a list of the form `\"invalid_arg_1, invalid_arg_2.\"` |
215 | 185 | The request succeeds despite the warnings. |
| 186 | + **See also:** [Synthesizing text to |
| 187 | + audio](https://console.bluemix.net/docs/services/text-to-speech/http.html#synthesize). |
216 | 188 |
|
217 | 189 | :param str text: The text to synthesize. |
218 | 190 | :param str accept: The requested audio format (MIME type) of the audio. You can |
@@ -268,6 +240,8 @@ def get_pronunciation(self, |
268 | 240 | specific voice to see the default translation for the language of that voice or |
269 | 241 | for a specific custom voice model to see the translation for that voice model. |
270 | 242 | **Note:** This method is currently a beta release. |
| 243 | + **See also:** [Querying a word from a |
| 244 | + language](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordsQueryLanguage). |
271 | 245 |
|
272 | 246 | :param str text: The word for which the pronunciation is requested. |
273 | 247 | :param str voice: A voice that specifies the language in which the pronunciation |
@@ -323,6 +297,8 @@ def create_voice_model(self, |
323 | 297 | model. The model is owned by the instance of the service whose credentials are |
324 | 298 | used to create it. |
325 | 299 | **Note:** This method is currently a beta release. |
| 300 | + **See also:** [Creating a custom |
| 301 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#cuModelsCreate). |
326 | 302 |
|
327 | 303 | :param str name: The name of the new custom voice model. |
328 | 304 | :param str language: The language of the new custom voice model. Omit the |
@@ -355,6 +331,8 @@ def delete_voice_model(self, customization_id, **kwargs): |
355 | 331 | Deletes the specified custom voice model. You must use credentials for the |
356 | 332 | instance of the service that owns a model to delete it. |
357 | 333 | **Note:** This method is currently a beta release. |
| 334 | + **See also:** [Deleting a custom |
| 335 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#cuModelsDelete). |
358 | 336 |
|
359 | 337 | :param str customization_id: The customization ID (GUID) of the custom voice |
360 | 338 | model. You must make the request with service credentials created for the instance |
@@ -383,6 +361,8 @@ def get_voice_model(self, customization_id, **kwargs): |
383 | 361 | and their translations as defined in the model. To see just the metadata for a |
384 | 362 | voice model, use the **List custom models** method. |
385 | 363 | **Note:** This method is currently a beta release. |
| 364 | + **See also:** [Querying a custom |
| 365 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#cuModelsQuery). |
386 | 366 |
|
387 | 367 | :param str customization_id: The customization ID (GUID) of the custom voice |
388 | 368 | model. You must make the request with service credentials created for the instance |
@@ -413,6 +393,8 @@ def list_voice_models(self, language=None, **kwargs): |
413 | 393 | credentials for the instance of the service that owns a model to list information |
414 | 394 | about it. |
415 | 395 | **Note:** This method is currently a beta release. |
| 396 | + **See also:** [Querying all custom |
| 397 | + models](https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#cuModelsQueryAll). |
416 | 398 |
|
417 | 399 | :param str language: The language for which custom voice models that are owned by |
418 | 400 | the requesting service credentials are to be returned. Omit the parameter to see |
@@ -449,7 +431,24 @@ def update_voice_model(self, |
449 | 431 | already exists in a custom model overwrites the word's existing translation. A |
450 | 432 | custom model can contain no more than 20,000 entries. You must use credentials for |
451 | 433 | the instance of the service that owns a model to update it. |
| 434 | + You can define sounds-like or phonetic translations for words. A sounds-like |
| 435 | + translation consists of one or more words that, when combined, sound like the |
| 436 | + word. Phonetic translations are based on the SSML phoneme format for representing |
| 437 | + a word. You can specify them in standard International Phonetic Alphabet (IPA) |
| 438 | + representation |
| 439 | + <code><phoneme alphabet=\"ipa\" |
| 440 | + ph=\"təmˈɑto\"></phoneme></code> |
| 441 | + or in the proprietary IBM Symbolic Phonetic Representation (SPR) |
| 442 | + <code><phoneme alphabet=\"ibm\" |
| 443 | + ph=\"1gAstroEntxrYFXs\"></phoneme></code> |
452 | 444 | **Note:** This method is currently a beta release. |
| 445 | + **See also:** |
| 446 | + * [Updating a custom |
| 447 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#cuModelsUpdate) |
| 448 | + * [Adding words to a Japanese custom |
| 449 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuJapaneseAdd) |
| 450 | + * [Understanding |
| 451 | + customization](https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html). |
453 | 452 |
|
454 | 453 | :param str customization_id: The customization ID (GUID) of the custom voice |
455 | 454 | model. You must make the request with service credentials created for the instance |
@@ -499,7 +498,24 @@ def add_word(self, |
499 | 498 | word's existing translation. A custom model can contain no more than 20,000 |
500 | 499 | entries. You must use credentials for the instance of the service that owns a |
501 | 500 | model to add a word to it. |
| 501 | + You can define sounds-like or phonetic translations for words. A sounds-like |
| 502 | + translation consists of one or more words that, when combined, sound like the |
| 503 | + word. Phonetic translations are based on the SSML phoneme format for representing |
| 504 | + a word. You can specify them in standard International Phonetic Alphabet (IPA) |
| 505 | + representation |
| 506 | + <code><phoneme alphabet=\"ipa\" |
| 507 | + ph=\"təmˈɑto\"></phoneme></code> |
| 508 | + or in the proprietary IBM Symbolic Phonetic Representation (SPR) |
| 509 | + <code><phoneme alphabet=\"ibm\" |
| 510 | + ph=\"1gAstroEntxrYFXs\"></phoneme></code> |
502 | 511 | **Note:** This method is currently a beta release. |
| 512 | + **See also:** |
| 513 | + * [Adding a single word to a custom |
| 514 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordAdd) |
| 515 | + * [Adding words to a Japanese custom |
| 516 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuJapaneseAdd) |
| 517 | + * [Understanding |
| 518 | + customization](https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html). |
503 | 519 |
|
504 | 520 | :param str customization_id: The customization ID (GUID) of the custom voice |
505 | 521 | model. You must make the request with service credentials created for the instance |
@@ -545,7 +561,24 @@ def add_words(self, customization_id, words, **kwargs): |
545 | 561 | overwrites the word's existing translation. A custom model can contain no more |
546 | 562 | than 20,000 entries. You must use credentials for the instance of the service that |
547 | 563 | owns a model to add words to it. |
| 564 | + You can define sounds-like or phonetic translations for words. A sounds-like |
| 565 | + translation consists of one or more words that, when combined, sound like the |
| 566 | + word. Phonetic translations are based on the SSML phoneme format for representing |
| 567 | + a word. You can specify them in standard International Phonetic Alphabet (IPA) |
| 568 | + representation |
| 569 | + <code><phoneme alphabet=\"ipa\" |
| 570 | + ph=\"təmˈɑto\"></phoneme></code> |
| 571 | + or in the proprietary IBM Symbolic Phonetic Representation (SPR) |
| 572 | + <code><phoneme alphabet=\"ibm\" |
| 573 | + ph=\"1gAstroEntxrYFXs\"></phoneme></code> |
548 | 574 | **Note:** This method is currently a beta release. |
| 575 | + **See also:** |
| 576 | + * [Adding multiple words to a custom |
| 577 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordsAdd) |
| 578 | + * [Adding words to a Japanese custom |
| 579 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuJapaneseAdd) |
| 580 | + * [Understanding |
| 581 | + customization](https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html). |
549 | 582 |
|
550 | 583 | :param str customization_id: The customization ID (GUID) of the custom voice |
551 | 584 | model. You must make the request with service credentials created for the instance |
@@ -587,6 +620,8 @@ def delete_word(self, customization_id, word, **kwargs): |
587 | 620 | Deletes a single word from the specified custom voice model. You must use |
588 | 621 | credentials for the instance of the service that owns a model to delete its words. |
589 | 622 | **Note:** This method is currently a beta release. |
| 623 | + **See also:** [Deleting a word from a custom |
| 624 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordDelete). |
590 | 625 |
|
591 | 626 | :param str customization_id: The customization ID (GUID) of the custom voice |
592 | 627 | model. You must make the request with service credentials created for the instance |
@@ -617,6 +652,8 @@ def get_word(self, customization_id, word, **kwargs): |
617 | 652 | shows the translation as it is defined in the model. You must use credentials for |
618 | 653 | the instance of the service that owns a model to list its words. |
619 | 654 | **Note:** This method is currently a beta release. |
| 655 | + **See also:** [Querying a single word from a custom |
| 656 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordQueryModel). |
620 | 657 |
|
621 | 658 | :param str customization_id: The customization ID (GUID) of the custom voice |
622 | 659 | model. You must make the request with service credentials created for the instance |
@@ -648,6 +685,8 @@ def list_words(self, customization_id, **kwargs): |
648 | 685 | must use credentials for the instance of the service that owns a model to list its |
649 | 686 | words. |
650 | 687 | **Note:** This method is currently a beta release. |
| 688 | + **See also:** [Querying all words from a custom |
| 689 | + model](https://console.bluemix.net/docs/services/text-to-speech/custom-entries.html#cuWordsQueryModel). |
651 | 690 |
|
652 | 691 | :param str customization_id: The customization ID (GUID) of the custom voice |
653 | 692 | model. You must make the request with service credentials created for the instance |
@@ -681,8 +720,8 @@ def delete_user_data(self, customer_id, **kwargs): |
681 | 720 | customer ID. You must issue the request with credentials for the same instance of |
682 | 721 | the service that was used to associate the customer ID with the data. |
683 | 722 | You associate a customer ID with data by passing the `X-Watson-Metadata` header |
684 | | - with a request that passes the data. For more information about customer IDs and |
685 | | - about using this method, see [Information |
| 723 | + with a request that passes the data. |
| 724 | + **See also:** [Information |
686 | 725 | security](https://console.bluemix.net/docs/services/text-to-speech/information-security.html). |
687 | 726 |
|
688 | 727 | :param str customer_id: The customer ID for which all data is to be deleted. |
|
0 commit comments