1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""
Create an audio format object.
Args:
container (Optional[str]): The container format for the audio. It can be either 'mp3', 'wav', 'ogg' or 'webm'.
quality (Optional[int]): The quality for the audio. Defaults to 0.
use_closest (Optional[bool]): Whether to use the closest quality if the specified quality does not exist. Defaults to False.
"""
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
"""
Create a speech service object.
Args:
audio_format (AudioFormat): The audio format for the output audio.
Kwargs:
endpoint (Optional[str]): The endpoint for the speech service. You must specify this if do not specify the region.
region (Optional[str]): The region for the speech service.
mode (Optional[str]): The mode for the speech service. It can be either 'rest' or 'websocket'. Defaults to 'rest'.
In websocket mode, the websocket connection will be established when this object is created.
key (Optional[str]): The subscription key for the speech service.
token (Optional[str]): The auth token for the speech service.
proxy (Optional[str]): The proxy for the speech service. Only http/socks5 proxy servers are supported by now.
headers (Optional[Iterable[Tuple[str, str]]]): Additional request headers.
"""
"""
Synthesize text to speech and output to speaker.
Args:
text (str): The text to synthesize.
Kwargs:
pitch (Optional[str]): The pitch for the speech.
rate (Optional[str]): The rate for the speech.
locale (Optional[str]): The locale for the speech.
voice (Optional[str]): The voice to be used. It takes precedence over locale.
style (Optional[str]): Speech style.
style_degree (Optional[float]): Speech style degree. It can be a float number between 0.01 and 2.
role (Optional[Role]): Speech role.
"""
"""
Synthesize text to speech.
Args:
text (str): The text to synthesize.
Kwargs:
output (Optional[str]): The output file path. If this argument is not specified, the audio data will be returned.
pitch (Optional[str]): The pitch for the speech.
rate (Optional[str]): The rate for the speech.
locale (Optional[str]): The locale for the speech.
voice (Optional[str]): The voice to be used. It takes precedence over locale.
style (Optional[str]): Speech style.
style_degree (Optional[float]): Speech style degree. It can be a float number between 0.01 and 2.
role (Optional[Role]): Speech role.
"""
"""
Synthesize SSML to speech and output to speaker.
Args:
ssml (str): The SSML to synthesize.
"""
"""
Synthesize SSML to speech.
Args:
ssml (str): The SSML to synthesize.
Kwargs:
output (Optional[str]): The output file path. If this argument is not specified, the audio data will be returned.
"""