1
1
# coding: utf-8
2
2
3
- # (C) Copyright IBM Corp. 2015, 2020.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
#
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
35
35
from .common import get_sdk_headers
36
36
from enum import Enum
37
37
from ibm_cloud_sdk_core import BaseService
38
- from ibm_cloud_sdk_core import get_authenticator_from_environment
38
+ from ibm_cloud_sdk_core import DetailedResponse
39
+ from ibm_cloud_sdk_core .get_authenticator import get_authenticator_from_environment
39
40
from typing import Dict
40
41
from typing import List
41
42
@@ -82,7 +83,7 @@ def list_voices(self, **kwargs) -> 'DetailedResponse':
82
83
name, language, gender, and other details about the voice. To see information
83
84
about a specific voice, use the **Get a voice** method.
84
85
**See also:** [Listing all available
85
- voices](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-voices#listVoices).
86
+ voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#listVoices).
86
87
87
88
:param dict headers: A `dict` containing the request headers
88
89
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -114,7 +115,7 @@ def get_voice(self, voice: str, *, customization_id: str = None,
114
115
the specified voice. To list information about all available voices, use the
115
116
**List voices** method.
116
117
**See also:** [Listing a specific
117
- voice](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-voices#listVoice).
118
+ voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#listVoice).
118
119
119
120
:param str voice: The voice for which information is to be returned.
120
121
:param str customization_id: (optional) The customization ID (GUID) of a
@@ -170,7 +171,7 @@ def synthesize(self,
170
171
8 KB for the URL and headers. The 5 KB limit includes any SSML tags that you
171
172
specify. The service returns the synthesized audio stream as an array of bytes.
172
173
**See also:** [The HTTP
173
- interface](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-usingHTTP#usingHTTP).
174
+ interface](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingHTTP#usingHTTP).
174
175
### Audio formats (accept types)
175
176
The service can return audio in the following formats (MIME types).
176
177
* Where indicated, you can optionally specify the sampling rate (`rate`) of the
@@ -213,7 +214,7 @@ def synthesize(self,
213
214
The default sampling rate is 22,050 Hz.
214
215
For more information about specifying an audio format, including additional
215
216
details about some of the formats, see [Audio
216
- formats](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-audioFormats#audioFormats).
217
+ formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audioFormats#audioFormats).
217
218
### Warning messages
218
219
If a request includes invalid query parameters, the service returns a `Warnings`
219
220
response header that provides messages about the invalid parameters. The warning
@@ -285,7 +286,7 @@ def get_pronunciation(self,
285
286
**Note:** This method is currently a beta release. The method does not support the
286
287
Arabic, Chinese, and Dutch languages.
287
288
**See also:** [Querying a word from a
288
- language](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordsQueryLanguage).
289
+ language](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryLanguage).
289
290
290
291
:param str text: The word for which the pronunciation is requested.
291
292
:param str voice: (optional) A voice that specifies the language in which
@@ -354,7 +355,7 @@ def create_voice_model(self,
354
355
**Note:** This method is currently a beta release. The service does not support
355
356
voice model customization for the Arabic, Chinese, and Dutch languages.
356
357
**See also:** [Creating a custom
357
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customModels#cuModelsCreate).
358
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsCreate).
358
359
359
360
:param str name: The name of the new custom voice model.
360
361
:param str language: (optional) The language of the new custom voice model.
@@ -401,7 +402,7 @@ def list_voice_models(self, *, language: str = None,
401
402
about it.
402
403
**Note:** This method is currently a beta release.
403
404
**See also:** [Querying all custom
404
- models](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customModels#cuModelsQueryAll).
405
+ models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsQueryAll).
405
406
406
407
:param str language: (optional) The language for which custom voice models
407
408
that are owned by the requesting credentials are to be returned. Omit the
@@ -459,11 +460,11 @@ def update_voice_model(self,
459
460
**Note:** This method is currently a beta release.
460
461
**See also:**
461
462
* [Updating a custom
462
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customModels#cuModelsUpdate)
463
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsUpdate)
463
464
* [Adding words to a Japanese custom
464
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
465
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
465
466
* [Understanding
466
- customization](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customIntro#customIntro).
467
+ customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
467
468
468
469
:param str customization_id: The customization ID (GUID) of the custom
469
470
voice model. You must make the request with credentials for the instance of
@@ -516,7 +517,7 @@ def get_voice_model(self, customization_id: str,
516
517
voice model, use the **List custom models** method.
517
518
**Note:** This method is currently a beta release.
518
519
**See also:** [Querying a custom
519
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customModels#cuModelsQuery).
520
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsQuery).
520
521
521
522
:param str customization_id: The customization ID (GUID) of the custom
522
523
voice model. You must make the request with credentials for the instance of
@@ -553,7 +554,7 @@ def delete_voice_model(self, customization_id: str,
553
554
instance of the service that owns a model to delete it.
554
555
**Note:** This method is currently a beta release.
555
556
**See also:** [Deleting a custom
556
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customModels#cuModelsDelete).
557
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModels#cuModelsDelete).
557
558
558
559
:param str customization_id: The customization ID (GUID) of the custom
559
560
voice model. You must make the request with credentials for the instance of
@@ -610,11 +611,11 @@ def add_words(self, customization_id: str, words: List['Word'],
610
611
**Note:** This method is currently a beta release.
611
612
**See also:**
612
613
* [Adding multiple words to a custom
613
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordsAdd)
614
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsAdd)
614
615
* [Adding words to a Japanese custom
615
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
616
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
616
617
* [Understanding
617
- customization](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customIntro#customIntro).
618
+ customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
618
619
619
620
:param str customization_id: The customization ID (GUID) of the custom
620
621
voice model. You must make the request with credentials for the instance of
@@ -668,7 +669,7 @@ def list_words(self, customization_id: str, **kwargs) -> 'DetailedResponse':
668
669
words.
669
670
**Note:** This method is currently a beta release.
670
671
**See also:** [Querying all words from a custom
671
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordsQueryModel).
672
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordsQueryModel).
672
673
673
674
:param str customization_id: The customization ID (GUID) of the custom
674
675
voice model. You must make the request with credentials for the instance of
@@ -724,11 +725,11 @@ def add_word(self,
724
725
**Note:** This method is currently a beta release.
725
726
**See also:**
726
727
* [Adding a single word to a custom
727
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordAdd)
728
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordAdd)
728
729
* [Adding words to a Japanese custom
729
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
730
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuJapaneseAdd)
730
731
* [Understanding
731
- customization](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customIntro#customIntro).
732
+ customization](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntro#customIntro).
732
733
733
734
:param str customization_id: The customization ID (GUID) of the custom
734
735
voice model. You must make the request with credentials for the instance of
@@ -746,7 +747,7 @@ def add_word(self,
746
747
part of speech, for any word; you cannot create multiple entries with
747
748
different parts of speech for the same word. For more information, see
748
749
[Working with Japanese
749
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
750
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
750
751
:param dict headers: A `dict` containing the request headers
751
752
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
752
753
:rtype: DetailedResponse
@@ -789,7 +790,7 @@ def get_word(self, customization_id: str, word: str,
789
790
the instance of the service that owns a model to list its words.
790
791
**Note:** This method is currently a beta release.
791
792
**See also:** [Querying a single word from a custom
792
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordQueryModel).
793
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordQueryModel).
793
794
794
795
:param str customization_id: The customization ID (GUID) of the custom
795
796
voice model. You must make the request with credentials for the instance of
@@ -830,7 +831,7 @@ def delete_word(self, customization_id: str, word: str,
830
831
credentials for the instance of the service that owns a model to delete its words.
831
832
**Note:** This method is currently a beta release.
832
833
**See also:** [Deleting a word from a custom
833
- model](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-customWords#cuWordDelete).
834
+ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customWords#cuWordDelete).
834
835
835
836
:param str customization_id: The customization ID (GUID) of the custom
836
837
voice model. You must make the request with credentials for the instance of
@@ -881,7 +882,7 @@ def delete_user_data(self, customer_id: str,
881
882
You associate a customer ID with data by passing the `X-Watson-Metadata` header
882
883
with a request that passes the data.
883
884
**See also:** [Information
884
- security](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-information-security#information-security).
885
+ security](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-information-security#information-security).
885
886
886
887
:param str customer_id: The customer ID for which all data is to be
887
888
deleted.
@@ -1248,7 +1249,7 @@ class Translation():
1248
1249
word. You can create only a single entry, with or without a single part of
1249
1250
speech, for any word; you cannot create multiple entries with different parts of
1250
1251
speech for the same word. For more information, see [Working with Japanese
1251
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1252
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1252
1253
"""
1253
1254
1254
1255
def __init__ (self , translation : str , * , part_of_speech : str = None ) -> None :
@@ -1266,7 +1267,7 @@ def __init__(self, translation: str, *, part_of_speech: str = None) -> None:
1266
1267
part of speech, for any word; you cannot create multiple entries with
1267
1268
different parts of speech for the same word. For more information, see
1268
1269
[Working with Japanese
1269
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1270
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1270
1271
"""
1271
1272
self .translation = translation
1272
1273
self .part_of_speech = part_of_speech
@@ -1330,7 +1331,7 @@ class PartOfSpeechEnum(Enum):
1330
1331
with or without a single part of speech, for any word; you cannot create multiple
1331
1332
entries with different parts of speech for the same word. For more information,
1332
1333
see [Working with Japanese
1333
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1334
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1334
1335
"""
1335
1336
DOSI = "Dosi"
1336
1337
FUKU = "Fuku"
@@ -1824,7 +1825,7 @@ class Word():
1824
1825
word. You can create only a single entry, with or without a single part of
1825
1826
speech, for any word; you cannot create multiple entries with different parts of
1826
1827
speech for the same word. For more information, see [Working with Japanese
1827
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1828
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1828
1829
"""
1829
1830
1830
1831
def __init__ (self ,
@@ -1847,7 +1848,7 @@ def __init__(self,
1847
1848
part of speech, for any word; you cannot create multiple entries with
1848
1849
different parts of speech for the same word. For more information, see
1849
1850
[Working with Japanese
1850
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1851
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1851
1852
"""
1852
1853
self .word = word
1853
1854
self .translation = translation
@@ -1918,7 +1919,7 @@ class PartOfSpeechEnum(Enum):
1918
1919
with or without a single part of speech, for any word; you cannot create multiple
1919
1920
entries with different parts of speech for the same word. For more information,
1920
1921
see [Working with Japanese
1921
- entries](https://cloud.ibm.com/docs/services/ text-to-speech?topic=text-to-speech-rules#jaNotes).
1922
+ entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes).
1922
1923
"""
1923
1924
DOSI = "Dosi"
1924
1925
FUKU = "Fuku"
0 commit comments