Skip to content

Commit 7889765

Browse files
committed
chore(TSS): Regenerate text to speech
1 parent b1d4a46 commit 7889765

1 file changed

Lines changed: 87 additions & 48 deletions

File tree

watson_developer_cloud/text_to_speech_v1.py

Lines changed: 87 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,20 @@
1515
# limitations under the License.
1616
"""
1717
### 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
1919
capabilities to synthesize text into natural-sounding speech in a variety of languages,
2020
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
2925
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).
6332
"""
6433

6534
from __future__ import absolute_import
@@ -141,6 +110,8 @@ def get_voice(self, voice, customization_id=None, **kwargs):
141110
language, gender, and other details about the voice. Specify a customization ID to
142111
obtain information for that custom voice model of the specified voice. To list
143112
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).
144115
145116
:param str voice: The voice for which information is to be returned.
146117
:param str customization_id: The customization ID (GUID) of a custom voice model
@@ -174,6 +145,8 @@ def list_voices(self, **kwargs):
174145
Lists all voices available for use with the service. The information includes the
175146
name, language, gender, and other details about the voice. To see information
176147
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).
177150
178151
:param dict headers: A `dict` containing the request headers
179152
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -203,16 +176,15 @@ def synthesize(self,
203176
Synthesizes text to spoken audio, returning the synthesized audio stream as an
204177
array of bytes. You can pass a maximum of 5 KB of text. Use the `Accept` header
205178
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`.
210180
If a request includes invalid query parameters, the service returns a `Warnings`
211181
response header that provides messages about the invalid parameters. The warning
212182
includes a descriptive message and a list of invalid argument strings. For
213183
example, a message such as `\"Unknown arguments:\"` or `\"Unknown url query
214184
arguments:\"` followed by a list of the form `\"invalid_arg_1, invalid_arg_2.\"`
215185
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).
216188
217189
:param str text: The text to synthesize.
218190
:param str accept: The requested audio format (MIME type) of the audio. You can
@@ -268,6 +240,8 @@ def get_pronunciation(self,
268240
specific voice to see the default translation for the language of that voice or
269241
for a specific custom voice model to see the translation for that voice model.
270242
**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).
271245
272246
:param str text: The word for which the pronunciation is requested.
273247
:param str voice: A voice that specifies the language in which the pronunciation
@@ -323,6 +297,8 @@ def create_voice_model(self,
323297
model. The model is owned by the instance of the service whose credentials are
324298
used to create it.
325299
**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).
326302
327303
:param str name: The name of the new custom voice model.
328304
: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):
355331
Deletes the specified custom voice model. You must use credentials for the
356332
instance of the service that owns a model to delete it.
357333
**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).
358336
359337
:param str customization_id: The customization ID (GUID) of the custom voice
360338
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):
383361
and their translations as defined in the model. To see just the metadata for a
384362
voice model, use the **List custom models** method.
385363
**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).
386366
387367
:param str customization_id: The customization ID (GUID) of the custom voice
388368
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):
413393
credentials for the instance of the service that owns a model to list information
414394
about it.
415395
**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).
416398
417399
:param str language: The language for which custom voice models that are owned by
418400
the requesting service credentials are to be returned. Omit the parameter to see
@@ -449,7 +431,24 @@ def update_voice_model(self,
449431
already exists in a custom model overwrites the word's existing translation. A
450432
custom model can contain no more than 20,000 entries. You must use credentials for
451433
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>&lt;phoneme alphabet=\"ipa\"
440+
ph=\"t&#601;m&#712;&#593;to\"&gt;&lt;/phoneme&gt;</code>
441+
or in the proprietary IBM Symbolic Phonetic Representation (SPR)
442+
<code>&lt;phoneme alphabet=\"ibm\"
443+
ph=\"1gAstroEntxrYFXs\"&gt;&lt;/phoneme&gt;</code>
452444
**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).
453452
454453
:param str customization_id: The customization ID (GUID) of the custom voice
455454
model. You must make the request with service credentials created for the instance
@@ -499,7 +498,24 @@ def add_word(self,
499498
word's existing translation. A custom model can contain no more than 20,000
500499
entries. You must use credentials for the instance of the service that owns a
501500
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>&lt;phoneme alphabet=\"ipa\"
507+
ph=\"t&#601;m&#712;&#593;to\"&gt;&lt;/phoneme&gt;</code>
508+
or in the proprietary IBM Symbolic Phonetic Representation (SPR)
509+
<code>&lt;phoneme alphabet=\"ibm\"
510+
ph=\"1gAstroEntxrYFXs\"&gt;&lt;/phoneme&gt;</code>
502511
**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).
503519
504520
:param str customization_id: The customization ID (GUID) of the custom voice
505521
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):
545561
overwrites the word's existing translation. A custom model can contain no more
546562
than 20,000 entries. You must use credentials for the instance of the service that
547563
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>&lt;phoneme alphabet=\"ipa\"
570+
ph=\"t&#601;m&#712;&#593;to\"&gt;&lt;/phoneme&gt;</code>
571+
or in the proprietary IBM Symbolic Phonetic Representation (SPR)
572+
<code>&lt;phoneme alphabet=\"ibm\"
573+
ph=\"1gAstroEntxrYFXs\"&gt;&lt;/phoneme&gt;</code>
548574
**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).
549582
550583
:param str customization_id: The customization ID (GUID) of the custom voice
551584
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):
587620
Deletes a single word from the specified custom voice model. You must use
588621
credentials for the instance of the service that owns a model to delete its words.
589622
**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).
590625
591626
:param str customization_id: The customization ID (GUID) of the custom voice
592627
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):
617652
shows the translation as it is defined in the model. You must use credentials for
618653
the instance of the service that owns a model to list its words.
619654
**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).
620657
621658
:param str customization_id: The customization ID (GUID) of the custom voice
622659
model. You must make the request with service credentials created for the instance
@@ -648,6 +685,8 @@ def list_words(self, customization_id, **kwargs):
648685
must use credentials for the instance of the service that owns a model to list its
649686
words.
650687
**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).
651690
652691
:param str customization_id: The customization ID (GUID) of the custom voice
653692
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):
681720
customer ID. You must issue the request with credentials for the same instance of
682721
the service that was used to associate the customer ID with the data.
683722
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
686725
security](https://console.bluemix.net/docs/services/text-to-speech/information-security.html).
687726
688727
:param str customer_id: The customer ID for which all data is to be deleted.

0 commit comments

Comments
 (0)