sarvamai 0.1.22a3__py3-none-any.whl → 0.1.22a7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sarvamai/__init__.py +62 -9
- sarvamai/client.py +3 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/doc_digitization_job/__init__.py +4 -0
- sarvamai/doc_digitization_job/client.py +776 -0
- sarvamai/doc_digitization_job/job.py +496 -0
- sarvamai/doc_digitization_job/raw_client.py +1176 -0
- sarvamai/requests/__init__.py +20 -0
- sarvamai/requests/audio_data.py +0 -6
- sarvamai/requests/configure_connection.py +4 -0
- sarvamai/requests/configure_connection_data.py +40 -11
- sarvamai/requests/doc_digitization_create_job_response.py +25 -0
- sarvamai/requests/doc_digitization_download_files_response.py +37 -0
- sarvamai/requests/doc_digitization_error_details.py +21 -0
- sarvamai/requests/doc_digitization_error_message.py +11 -0
- sarvamai/requests/doc_digitization_job_detail.py +64 -0
- sarvamai/requests/doc_digitization_job_parameters.py +21 -0
- sarvamai/requests/doc_digitization_job_status_response.py +65 -0
- sarvamai/requests/doc_digitization_page_error.py +24 -0
- sarvamai/requests/doc_digitization_upload_files_response.py +34 -0
- sarvamai/requests/doc_digitization_webhook_callback.py +19 -0
- sarvamai/requests/speech_to_text_job_parameters.py +43 -2
- sarvamai/requests/speech_to_text_transcription_data.py +0 -6
- sarvamai/requests/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/requests/speech_to_text_translate_transcription_data.py +0 -6
- sarvamai/speech_to_text/client.py +95 -10
- sarvamai/speech_to_text/raw_client.py +95 -10
- sarvamai/speech_to_text_job/client.py +60 -15
- sarvamai/speech_to_text_job/job.py +100 -2
- sarvamai/speech_to_text_job/raw_client.py +14 -10
- sarvamai/speech_to_text_streaming/__init__.py +4 -2
- sarvamai/speech_to_text_streaming/client.py +100 -47
- sarvamai/speech_to_text_streaming/raw_client.py +100 -47
- sarvamai/speech_to_text_streaming/types/__init__.py +4 -2
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_input_audio_codec.py +1 -27
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_mode.py +7 -0
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +5 -0
- sarvamai/speech_to_text_translate_job/job.py +100 -2
- sarvamai/speech_to_text_translate_job/raw_client.py +14 -10
- sarvamai/speech_to_text_translate_streaming/__init__.py +0 -2
- sarvamai/speech_to_text_translate_streaming/client.py +18 -41
- sarvamai/speech_to_text_translate_streaming/raw_client.py +18 -41
- sarvamai/speech_to_text_translate_streaming/types/__init__.py +0 -4
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_input_audio_codec.py +1 -27
- sarvamai/text/client.py +0 -12
- sarvamai/text/raw_client.py +0 -12
- sarvamai/text_to_speech/client.py +116 -14
- sarvamai/text_to_speech/raw_client.py +116 -14
- sarvamai/text_to_speech_streaming/__init__.py +2 -2
- sarvamai/text_to_speech_streaming/client.py +19 -6
- sarvamai/text_to_speech_streaming/raw_client.py +19 -6
- sarvamai/text_to_speech_streaming/types/__init__.py +2 -1
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- sarvamai/types/__init__.py +34 -4
- sarvamai/types/audio_data.py +0 -6
- sarvamai/types/completion_event_flag.py +3 -1
- sarvamai/types/configure_connection.py +4 -0
- sarvamai/types/configure_connection_data.py +40 -11
- sarvamai/types/configure_connection_data_model.py +5 -0
- sarvamai/types/configure_connection_data_speaker.py +35 -1
- sarvamai/types/doc_digitization_create_job_response.py +37 -0
- sarvamai/types/doc_digitization_download_files_response.py +47 -0
- sarvamai/types/doc_digitization_error_code.py +15 -0
- sarvamai/types/doc_digitization_error_details.py +33 -0
- sarvamai/types/doc_digitization_error_message.py +23 -0
- sarvamai/types/doc_digitization_job_detail.py +74 -0
- sarvamai/types/doc_digitization_job_detail_state.py +7 -0
- sarvamai/types/doc_digitization_job_parameters.py +33 -0
- sarvamai/types/doc_digitization_job_state.py +7 -0
- sarvamai/types/doc_digitization_job_status_response.py +75 -0
- sarvamai/types/doc_digitization_output_format.py +5 -0
- sarvamai/types/doc_digitization_page_error.py +36 -0
- sarvamai/types/doc_digitization_supported_language.py +32 -0
- sarvamai/types/doc_digitization_upload_files_response.py +44 -0
- sarvamai/types/doc_digitization_webhook_callback.py +31 -0
- sarvamai/types/mode.py +5 -0
- sarvamai/types/speech_to_text_job_parameters.py +43 -2
- sarvamai/types/speech_to_text_model.py +1 -1
- sarvamai/types/speech_to_text_transcription_data.py +0 -6
- sarvamai/types/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/types/speech_to_text_translate_transcription_data.py +0 -6
- sarvamai/types/text_to_speech_model.py +1 -1
- sarvamai/types/text_to_speech_speaker.py +35 -1
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.dist-info}/METADATA +1 -1
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.dist-info}/RECORD +86 -56
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_stream_ongoing_speech_results.py +0 -5
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_stream_ongoing_speech_results.py +0 -5
- sarvamai/types/audio_data_input_audio_codec.py +0 -33
- sarvamai/types/response_speech_state.py +0 -7
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.dist-info}/WHEEL +0 -0
sarvamai/text/raw_client.py
CHANGED
|
@@ -44,7 +44,6 @@ class RawTextClient:
|
|
|
44
44
|
speaker_gender: typing.Optional[TranslateSpeakerGender] = OMIT,
|
|
45
45
|
mode: typing.Optional[TranslateMode] = OMIT,
|
|
46
46
|
model: typing.Optional[TranslateModel] = OMIT,
|
|
47
|
-
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
48
47
|
output_script: typing.Optional[TransliterateMode] = OMIT,
|
|
49
48
|
numerals_format: typing.Optional[NumeralsFormat] = OMIT,
|
|
50
49
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -122,10 +121,6 @@ class RawTextClient:
|
|
|
122
121
|
- mayura:v1: Supports 12 languages with all modes, output scripts, and automatic language detection.
|
|
123
122
|
- sarvam-translate:v1: Supports all 22 scheduled languages of India, formal mode only.
|
|
124
123
|
|
|
125
|
-
enable_preprocessing : typing.Optional[bool]
|
|
126
|
-
This will enable custom preprocessing of the input text which can result in better translations.
|
|
127
|
-
Recommendation- You can switch on whenever there is some complex text with difficult vocabulary and sentences, for which you want simple translations that people can understand.
|
|
128
|
-
|
|
129
124
|
output_script : typing.Optional[TransliterateMode]
|
|
130
125
|
**output_script**: This is an optional parameter which controls the transliteration style applied to the output text.
|
|
131
126
|
|
|
@@ -174,7 +169,6 @@ class RawTextClient:
|
|
|
174
169
|
"speaker_gender": speaker_gender,
|
|
175
170
|
"mode": mode,
|
|
176
171
|
"model": model,
|
|
177
|
-
"enable_preprocessing": enable_preprocessing,
|
|
178
172
|
"output_script": output_script,
|
|
179
173
|
"numerals_format": numerals_format,
|
|
180
174
|
},
|
|
@@ -554,7 +548,6 @@ class AsyncRawTextClient:
|
|
|
554
548
|
speaker_gender: typing.Optional[TranslateSpeakerGender] = OMIT,
|
|
555
549
|
mode: typing.Optional[TranslateMode] = OMIT,
|
|
556
550
|
model: typing.Optional[TranslateModel] = OMIT,
|
|
557
|
-
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
558
551
|
output_script: typing.Optional[TransliterateMode] = OMIT,
|
|
559
552
|
numerals_format: typing.Optional[NumeralsFormat] = OMIT,
|
|
560
553
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -632,10 +625,6 @@ class AsyncRawTextClient:
|
|
|
632
625
|
- mayura:v1: Supports 12 languages with all modes, output scripts, and automatic language detection.
|
|
633
626
|
- sarvam-translate:v1: Supports all 22 scheduled languages of India, formal mode only.
|
|
634
627
|
|
|
635
|
-
enable_preprocessing : typing.Optional[bool]
|
|
636
|
-
This will enable custom preprocessing of the input text which can result in better translations.
|
|
637
|
-
Recommendation- You can switch on whenever there is some complex text with difficult vocabulary and sentences, for which you want simple translations that people can understand.
|
|
638
|
-
|
|
639
628
|
output_script : typing.Optional[TransliterateMode]
|
|
640
629
|
**output_script**: This is an optional parameter which controls the transliteration style applied to the output text.
|
|
641
630
|
|
|
@@ -684,7 +673,6 @@ class AsyncRawTextClient:
|
|
|
684
673
|
"speaker_gender": speaker_gender,
|
|
685
674
|
"mode": mode,
|
|
686
675
|
"model": model,
|
|
687
|
-
"enable_preprocessing": enable_preprocessing,
|
|
688
676
|
"output_script": output_script,
|
|
689
677
|
"numerals_format": numerals_format,
|
|
690
678
|
},
|
|
@@ -44,15 +44,38 @@ class TextToSpeechClient:
|
|
|
44
44
|
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
45
45
|
model: typing.Optional[TextToSpeechModel] = OMIT,
|
|
46
46
|
output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
|
|
47
|
+
temperature: typing.Optional[float] = OMIT,
|
|
47
48
|
request_options: typing.Optional[RequestOptions] = None,
|
|
48
49
|
) -> TextToSpeechResponse:
|
|
49
50
|
"""
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
Convert text into spoken audio. The output is a wave file encoded as a base64 string.
|
|
52
|
+
|
|
53
|
+
**Available Models:**
|
|
54
|
+
- **bulbul:v2** (default): Supports pitch, loudness, and pace controls
|
|
55
|
+
- **bulbul:v3-beta**: Newer model with temperature control and improved quality
|
|
56
|
+
|
|
57
|
+
**Important Notes for bulbul:v3-beta:**
|
|
58
|
+
- Pitch and loudness parameters are NOT supported
|
|
59
|
+
- Pace must be between 0.5 and 2.0
|
|
60
|
+
- Preprocessing is automatically enabled
|
|
61
|
+
- Default sample rate is 24000 Hz
|
|
62
|
+
- Temperature parameter available (0.01-1.0, default 0.6)
|
|
52
63
|
|
|
53
64
|
Parameters
|
|
54
65
|
----------
|
|
55
66
|
text : str
|
|
67
|
+
The text(s) to be converted into speech.
|
|
68
|
+
|
|
69
|
+
**Features:**
|
|
70
|
+
- Supports code-mixed text (English and Indic languages)
|
|
71
|
+
|
|
72
|
+
**Model-specific limits:**
|
|
73
|
+
- **bulbul:v2:** Max 1500 characters
|
|
74
|
+
- **bulbul:v3-beta:** Max 2500 characters
|
|
75
|
+
|
|
76
|
+
**Important Note:**
|
|
77
|
+
- For numbers larger than 4 digits, use commas (e.g., '10,000' instead of '10000')
|
|
78
|
+
- This ensures proper pronunciation as a whole number
|
|
56
79
|
|
|
57
80
|
target_language_code : TextToSpeechLanguage
|
|
58
81
|
The language of the text is BCP-47 format
|
|
@@ -60,36 +83,63 @@ class TextToSpeechClient:
|
|
|
60
83
|
speaker : typing.Optional[TextToSpeechSpeaker]
|
|
61
84
|
The speaker voice to be used for the output audio.
|
|
62
85
|
|
|
63
|
-
**Default:** Anushka
|
|
86
|
+
**Default:** Anushka (for bulbul:v2), Aditya (for bulbul:v3-beta)
|
|
64
87
|
|
|
65
88
|
**Model Compatibility (Speakers compatible with respective model):**
|
|
66
89
|
- **bulbul:v2:**
|
|
67
90
|
- Female: Anushka, Manisha, Vidya, Arya
|
|
68
91
|
- Male: Abhilash, Karun, Hitesh
|
|
92
|
+
- **bulbul:v3-beta:**
|
|
93
|
+
- Aditya, Ritu, Priya, Neha, Rahul, Pooja, Rohan, Simran, Kavya, Amit, Dev, Ishita, Shreya, Ratan, Varun, Manan, Sumit, Roopa, Kabir, Aayan, Shubh, Ashutosh, Advait, Amelia, Sophia
|
|
69
94
|
|
|
70
95
|
**Note:** Speaker selection must match the chosen model version.
|
|
71
96
|
|
|
72
97
|
pitch : typing.Optional[float]
|
|
73
98
|
Controls the pitch of the audio. Lower values result in a deeper voice, while higher values make it sharper. The suitable range is between -0.75 and 0.75. Default is 0.0.
|
|
74
99
|
|
|
100
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
101
|
+
|
|
75
102
|
pace : typing.Optional[float]
|
|
76
|
-
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster.
|
|
103
|
+
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster. Default is 1.0.
|
|
104
|
+
|
|
105
|
+
**Model-specific ranges:**
|
|
106
|
+
- **bulbul:v2:** 0.3 to 3.0
|
|
107
|
+
- **bulbul:v3-beta:** 0.5 to 2.0
|
|
77
108
|
|
|
78
109
|
loudness : typing.Optional[float]
|
|
79
110
|
Controls the loudness of the audio. Lower values result in quieter audio, while higher values make it louder. The suitable range is between 0.3 and 3.0. Default is 1.0.
|
|
80
111
|
|
|
112
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
113
|
+
|
|
81
114
|
speech_sample_rate : typing.Optional[SpeechSampleRate]
|
|
82
|
-
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
115
|
+
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
116
|
+
|
|
117
|
+
**Model-specific defaults:**
|
|
118
|
+
- **bulbul:v2:** Default is 22050 Hz
|
|
119
|
+
- **bulbul:v3-beta:** Default is 24000 Hz
|
|
83
120
|
|
|
84
121
|
enable_preprocessing : typing.Optional[bool]
|
|
85
|
-
|
|
122
|
+
Controls whether normalization of English words and numeric entities (e.g., numbers, dates) is performed. Set to true for better handling of mixed-language text.
|
|
123
|
+
|
|
124
|
+
**Model-specific behavior:**
|
|
125
|
+
- **bulbul:v2:** Default is false
|
|
126
|
+
- **bulbul:v3-beta:** Automatically enabled (true) and cannot be disabled
|
|
86
127
|
|
|
87
128
|
model : typing.Optional[TextToSpeechModel]
|
|
88
|
-
Specifies the model to use for text-to-speech conversion.
|
|
129
|
+
Specifies the model to use for text-to-speech conversion.
|
|
130
|
+
|
|
131
|
+
**Available models:**
|
|
132
|
+
- **bulbul:v2:** Default model with pitch, loudness controls
|
|
133
|
+
- **bulbul:v3-beta:** Newer model with temperature control, improved quality
|
|
89
134
|
|
|
90
135
|
output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
|
|
91
136
|
Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
|
|
92
137
|
|
|
138
|
+
temperature : typing.Optional[float]
|
|
139
|
+
Controls the randomness of the output. Lower values make the output more focused and deterministic, while higher values make it more random. The suitable range is between 0.01 and 1.0. Default is 0.6.
|
|
140
|
+
|
|
141
|
+
**Note:** This parameter is only supported for bulbul:v3-beta. It has no effect on bulbul:v2.
|
|
142
|
+
|
|
93
143
|
request_options : typing.Optional[RequestOptions]
|
|
94
144
|
Request-specific configuration.
|
|
95
145
|
|
|
@@ -121,6 +171,7 @@ class TextToSpeechClient:
|
|
|
121
171
|
enable_preprocessing=enable_preprocessing,
|
|
122
172
|
model=model,
|
|
123
173
|
output_audio_codec=output_audio_codec,
|
|
174
|
+
temperature=temperature,
|
|
124
175
|
request_options=request_options,
|
|
125
176
|
)
|
|
126
177
|
return _response.data
|
|
@@ -154,15 +205,38 @@ class AsyncTextToSpeechClient:
|
|
|
154
205
|
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
155
206
|
model: typing.Optional[TextToSpeechModel] = OMIT,
|
|
156
207
|
output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
|
|
208
|
+
temperature: typing.Optional[float] = OMIT,
|
|
157
209
|
request_options: typing.Optional[RequestOptions] = None,
|
|
158
210
|
) -> TextToSpeechResponse:
|
|
159
211
|
"""
|
|
160
|
-
|
|
161
|
-
|
|
212
|
+
Convert text into spoken audio. The output is a wave file encoded as a base64 string.
|
|
213
|
+
|
|
214
|
+
**Available Models:**
|
|
215
|
+
- **bulbul:v2** (default): Supports pitch, loudness, and pace controls
|
|
216
|
+
- **bulbul:v3-beta**: Newer model with temperature control and improved quality
|
|
217
|
+
|
|
218
|
+
**Important Notes for bulbul:v3-beta:**
|
|
219
|
+
- Pitch and loudness parameters are NOT supported
|
|
220
|
+
- Pace must be between 0.5 and 2.0
|
|
221
|
+
- Preprocessing is automatically enabled
|
|
222
|
+
- Default sample rate is 24000 Hz
|
|
223
|
+
- Temperature parameter available (0.01-1.0, default 0.6)
|
|
162
224
|
|
|
163
225
|
Parameters
|
|
164
226
|
----------
|
|
165
227
|
text : str
|
|
228
|
+
The text(s) to be converted into speech.
|
|
229
|
+
|
|
230
|
+
**Features:**
|
|
231
|
+
- Supports code-mixed text (English and Indic languages)
|
|
232
|
+
|
|
233
|
+
**Model-specific limits:**
|
|
234
|
+
- **bulbul:v2:** Max 1500 characters
|
|
235
|
+
- **bulbul:v3-beta:** Max 2500 characters
|
|
236
|
+
|
|
237
|
+
**Important Note:**
|
|
238
|
+
- For numbers larger than 4 digits, use commas (e.g., '10,000' instead of '10000')
|
|
239
|
+
- This ensures proper pronunciation as a whole number
|
|
166
240
|
|
|
167
241
|
target_language_code : TextToSpeechLanguage
|
|
168
242
|
The language of the text is BCP-47 format
|
|
@@ -170,36 +244,63 @@ class AsyncTextToSpeechClient:
|
|
|
170
244
|
speaker : typing.Optional[TextToSpeechSpeaker]
|
|
171
245
|
The speaker voice to be used for the output audio.
|
|
172
246
|
|
|
173
|
-
**Default:** Anushka
|
|
247
|
+
**Default:** Anushka (for bulbul:v2), Aditya (for bulbul:v3-beta)
|
|
174
248
|
|
|
175
249
|
**Model Compatibility (Speakers compatible with respective model):**
|
|
176
250
|
- **bulbul:v2:**
|
|
177
251
|
- Female: Anushka, Manisha, Vidya, Arya
|
|
178
252
|
- Male: Abhilash, Karun, Hitesh
|
|
253
|
+
- **bulbul:v3-beta:**
|
|
254
|
+
- Aditya, Ritu, Priya, Neha, Rahul, Pooja, Rohan, Simran, Kavya, Amit, Dev, Ishita, Shreya, Ratan, Varun, Manan, Sumit, Roopa, Kabir, Aayan, Shubh, Ashutosh, Advait, Amelia, Sophia
|
|
179
255
|
|
|
180
256
|
**Note:** Speaker selection must match the chosen model version.
|
|
181
257
|
|
|
182
258
|
pitch : typing.Optional[float]
|
|
183
259
|
Controls the pitch of the audio. Lower values result in a deeper voice, while higher values make it sharper. The suitable range is between -0.75 and 0.75. Default is 0.0.
|
|
184
260
|
|
|
261
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
262
|
+
|
|
185
263
|
pace : typing.Optional[float]
|
|
186
|
-
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster.
|
|
264
|
+
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster. Default is 1.0.
|
|
265
|
+
|
|
266
|
+
**Model-specific ranges:**
|
|
267
|
+
- **bulbul:v2:** 0.3 to 3.0
|
|
268
|
+
- **bulbul:v3-beta:** 0.5 to 2.0
|
|
187
269
|
|
|
188
270
|
loudness : typing.Optional[float]
|
|
189
271
|
Controls the loudness of the audio. Lower values result in quieter audio, while higher values make it louder. The suitable range is between 0.3 and 3.0. Default is 1.0.
|
|
190
272
|
|
|
273
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
274
|
+
|
|
191
275
|
speech_sample_rate : typing.Optional[SpeechSampleRate]
|
|
192
|
-
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
276
|
+
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
277
|
+
|
|
278
|
+
**Model-specific defaults:**
|
|
279
|
+
- **bulbul:v2:** Default is 22050 Hz
|
|
280
|
+
- **bulbul:v3-beta:** Default is 24000 Hz
|
|
193
281
|
|
|
194
282
|
enable_preprocessing : typing.Optional[bool]
|
|
195
|
-
|
|
283
|
+
Controls whether normalization of English words and numeric entities (e.g., numbers, dates) is performed. Set to true for better handling of mixed-language text.
|
|
284
|
+
|
|
285
|
+
**Model-specific behavior:**
|
|
286
|
+
- **bulbul:v2:** Default is false
|
|
287
|
+
- **bulbul:v3-beta:** Automatically enabled (true) and cannot be disabled
|
|
196
288
|
|
|
197
289
|
model : typing.Optional[TextToSpeechModel]
|
|
198
|
-
Specifies the model to use for text-to-speech conversion.
|
|
290
|
+
Specifies the model to use for text-to-speech conversion.
|
|
291
|
+
|
|
292
|
+
**Available models:**
|
|
293
|
+
- **bulbul:v2:** Default model with pitch, loudness controls
|
|
294
|
+
- **bulbul:v3-beta:** Newer model with temperature control, improved quality
|
|
199
295
|
|
|
200
296
|
output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
|
|
201
297
|
Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
|
|
202
298
|
|
|
299
|
+
temperature : typing.Optional[float]
|
|
300
|
+
Controls the randomness of the output. Lower values make the output more focused and deterministic, while higher values make it more random. The suitable range is between 0.01 and 1.0. Default is 0.6.
|
|
301
|
+
|
|
302
|
+
**Note:** This parameter is only supported for bulbul:v3-beta. It has no effect on bulbul:v2.
|
|
303
|
+
|
|
203
304
|
request_options : typing.Optional[RequestOptions]
|
|
204
305
|
Request-specific configuration.
|
|
205
306
|
|
|
@@ -239,6 +340,7 @@ class AsyncTextToSpeechClient:
|
|
|
239
340
|
enable_preprocessing=enable_preprocessing,
|
|
240
341
|
model=model,
|
|
241
342
|
output_audio_codec=output_audio_codec,
|
|
343
|
+
temperature=temperature,
|
|
242
344
|
request_options=request_options,
|
|
243
345
|
)
|
|
244
346
|
return _response.data
|
|
@@ -41,15 +41,38 @@ class RawTextToSpeechClient:
|
|
|
41
41
|
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
42
42
|
model: typing.Optional[TextToSpeechModel] = OMIT,
|
|
43
43
|
output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
|
|
44
|
+
temperature: typing.Optional[float] = OMIT,
|
|
44
45
|
request_options: typing.Optional[RequestOptions] = None,
|
|
45
46
|
) -> HttpResponse[TextToSpeechResponse]:
|
|
46
47
|
"""
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
Convert text into spoken audio. The output is a wave file encoded as a base64 string.
|
|
49
|
+
|
|
50
|
+
**Available Models:**
|
|
51
|
+
- **bulbul:v2** (default): Supports pitch, loudness, and pace controls
|
|
52
|
+
- **bulbul:v3-beta**: Newer model with temperature control and improved quality
|
|
53
|
+
|
|
54
|
+
**Important Notes for bulbul:v3-beta:**
|
|
55
|
+
- Pitch and loudness parameters are NOT supported
|
|
56
|
+
- Pace must be between 0.5 and 2.0
|
|
57
|
+
- Preprocessing is automatically enabled
|
|
58
|
+
- Default sample rate is 24000 Hz
|
|
59
|
+
- Temperature parameter available (0.01-1.0, default 0.6)
|
|
49
60
|
|
|
50
61
|
Parameters
|
|
51
62
|
----------
|
|
52
63
|
text : str
|
|
64
|
+
The text(s) to be converted into speech.
|
|
65
|
+
|
|
66
|
+
**Features:**
|
|
67
|
+
- Supports code-mixed text (English and Indic languages)
|
|
68
|
+
|
|
69
|
+
**Model-specific limits:**
|
|
70
|
+
- **bulbul:v2:** Max 1500 characters
|
|
71
|
+
- **bulbul:v3-beta:** Max 2500 characters
|
|
72
|
+
|
|
73
|
+
**Important Note:**
|
|
74
|
+
- For numbers larger than 4 digits, use commas (e.g., '10,000' instead of '10000')
|
|
75
|
+
- This ensures proper pronunciation as a whole number
|
|
53
76
|
|
|
54
77
|
target_language_code : TextToSpeechLanguage
|
|
55
78
|
The language of the text is BCP-47 format
|
|
@@ -57,36 +80,63 @@ class RawTextToSpeechClient:
|
|
|
57
80
|
speaker : typing.Optional[TextToSpeechSpeaker]
|
|
58
81
|
The speaker voice to be used for the output audio.
|
|
59
82
|
|
|
60
|
-
**Default:** Anushka
|
|
83
|
+
**Default:** Anushka (for bulbul:v2), Aditya (for bulbul:v3-beta)
|
|
61
84
|
|
|
62
85
|
**Model Compatibility (Speakers compatible with respective model):**
|
|
63
86
|
- **bulbul:v2:**
|
|
64
87
|
- Female: Anushka, Manisha, Vidya, Arya
|
|
65
88
|
- Male: Abhilash, Karun, Hitesh
|
|
89
|
+
- **bulbul:v3-beta:**
|
|
90
|
+
- Aditya, Ritu, Priya, Neha, Rahul, Pooja, Rohan, Simran, Kavya, Amit, Dev, Ishita, Shreya, Ratan, Varun, Manan, Sumit, Roopa, Kabir, Aayan, Shubh, Ashutosh, Advait, Amelia, Sophia
|
|
66
91
|
|
|
67
92
|
**Note:** Speaker selection must match the chosen model version.
|
|
68
93
|
|
|
69
94
|
pitch : typing.Optional[float]
|
|
70
95
|
Controls the pitch of the audio. Lower values result in a deeper voice, while higher values make it sharper. The suitable range is between -0.75 and 0.75. Default is 0.0.
|
|
71
96
|
|
|
97
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
98
|
+
|
|
72
99
|
pace : typing.Optional[float]
|
|
73
|
-
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster.
|
|
100
|
+
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster. Default is 1.0.
|
|
101
|
+
|
|
102
|
+
**Model-specific ranges:**
|
|
103
|
+
- **bulbul:v2:** 0.3 to 3.0
|
|
104
|
+
- **bulbul:v3-beta:** 0.5 to 2.0
|
|
74
105
|
|
|
75
106
|
loudness : typing.Optional[float]
|
|
76
107
|
Controls the loudness of the audio. Lower values result in quieter audio, while higher values make it louder. The suitable range is between 0.3 and 3.0. Default is 1.0.
|
|
77
108
|
|
|
109
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
110
|
+
|
|
78
111
|
speech_sample_rate : typing.Optional[SpeechSampleRate]
|
|
79
|
-
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
112
|
+
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
113
|
+
|
|
114
|
+
**Model-specific defaults:**
|
|
115
|
+
- **bulbul:v2:** Default is 22050 Hz
|
|
116
|
+
- **bulbul:v3-beta:** Default is 24000 Hz
|
|
80
117
|
|
|
81
118
|
enable_preprocessing : typing.Optional[bool]
|
|
82
|
-
|
|
119
|
+
Controls whether normalization of English words and numeric entities (e.g., numbers, dates) is performed. Set to true for better handling of mixed-language text.
|
|
120
|
+
|
|
121
|
+
**Model-specific behavior:**
|
|
122
|
+
- **bulbul:v2:** Default is false
|
|
123
|
+
- **bulbul:v3-beta:** Automatically enabled (true) and cannot be disabled
|
|
83
124
|
|
|
84
125
|
model : typing.Optional[TextToSpeechModel]
|
|
85
|
-
Specifies the model to use for text-to-speech conversion.
|
|
126
|
+
Specifies the model to use for text-to-speech conversion.
|
|
127
|
+
|
|
128
|
+
**Available models:**
|
|
129
|
+
- **bulbul:v2:** Default model with pitch, loudness controls
|
|
130
|
+
- **bulbul:v3-beta:** Newer model with temperature control, improved quality
|
|
86
131
|
|
|
87
132
|
output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
|
|
88
133
|
Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
|
|
89
134
|
|
|
135
|
+
temperature : typing.Optional[float]
|
|
136
|
+
Controls the randomness of the output. Lower values make the output more focused and deterministic, while higher values make it more random. The suitable range is between 0.01 and 1.0. Default is 0.6.
|
|
137
|
+
|
|
138
|
+
**Note:** This parameter is only supported for bulbul:v3-beta. It has no effect on bulbul:v2.
|
|
139
|
+
|
|
90
140
|
request_options : typing.Optional[RequestOptions]
|
|
91
141
|
Request-specific configuration.
|
|
92
142
|
|
|
@@ -110,6 +160,7 @@ class RawTextToSpeechClient:
|
|
|
110
160
|
"enable_preprocessing": enable_preprocessing,
|
|
111
161
|
"model": model,
|
|
112
162
|
"output_audio_codec": output_audio_codec,
|
|
163
|
+
"temperature": temperature,
|
|
113
164
|
},
|
|
114
165
|
headers={
|
|
115
166
|
"content-type": "application/json",
|
|
@@ -205,15 +256,38 @@ class AsyncRawTextToSpeechClient:
|
|
|
205
256
|
enable_preprocessing: typing.Optional[bool] = OMIT,
|
|
206
257
|
model: typing.Optional[TextToSpeechModel] = OMIT,
|
|
207
258
|
output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
|
|
259
|
+
temperature: typing.Optional[float] = OMIT,
|
|
208
260
|
request_options: typing.Optional[RequestOptions] = None,
|
|
209
261
|
) -> AsyncHttpResponse[TextToSpeechResponse]:
|
|
210
262
|
"""
|
|
211
|
-
|
|
212
|
-
|
|
263
|
+
Convert text into spoken audio. The output is a wave file encoded as a base64 string.
|
|
264
|
+
|
|
265
|
+
**Available Models:**
|
|
266
|
+
- **bulbul:v2** (default): Supports pitch, loudness, and pace controls
|
|
267
|
+
- **bulbul:v3-beta**: Newer model with temperature control and improved quality
|
|
268
|
+
|
|
269
|
+
**Important Notes for bulbul:v3-beta:**
|
|
270
|
+
- Pitch and loudness parameters are NOT supported
|
|
271
|
+
- Pace must be between 0.5 and 2.0
|
|
272
|
+
- Preprocessing is automatically enabled
|
|
273
|
+
- Default sample rate is 24000 Hz
|
|
274
|
+
- Temperature parameter available (0.01-1.0, default 0.6)
|
|
213
275
|
|
|
214
276
|
Parameters
|
|
215
277
|
----------
|
|
216
278
|
text : str
|
|
279
|
+
The text(s) to be converted into speech.
|
|
280
|
+
|
|
281
|
+
**Features:**
|
|
282
|
+
- Supports code-mixed text (English and Indic languages)
|
|
283
|
+
|
|
284
|
+
**Model-specific limits:**
|
|
285
|
+
- **bulbul:v2:** Max 1500 characters
|
|
286
|
+
- **bulbul:v3-beta:** Max 2500 characters
|
|
287
|
+
|
|
288
|
+
**Important Note:**
|
|
289
|
+
- For numbers larger than 4 digits, use commas (e.g., '10,000' instead of '10000')
|
|
290
|
+
- This ensures proper pronunciation as a whole number
|
|
217
291
|
|
|
218
292
|
target_language_code : TextToSpeechLanguage
|
|
219
293
|
The language of the text is BCP-47 format
|
|
@@ -221,36 +295,63 @@ class AsyncRawTextToSpeechClient:
|
|
|
221
295
|
speaker : typing.Optional[TextToSpeechSpeaker]
|
|
222
296
|
The speaker voice to be used for the output audio.
|
|
223
297
|
|
|
224
|
-
**Default:** Anushka
|
|
298
|
+
**Default:** Anushka (for bulbul:v2), Aditya (for bulbul:v3-beta)
|
|
225
299
|
|
|
226
300
|
**Model Compatibility (Speakers compatible with respective model):**
|
|
227
301
|
- **bulbul:v2:**
|
|
228
302
|
- Female: Anushka, Manisha, Vidya, Arya
|
|
229
303
|
- Male: Abhilash, Karun, Hitesh
|
|
304
|
+
- **bulbul:v3-beta:**
|
|
305
|
+
- Aditya, Ritu, Priya, Neha, Rahul, Pooja, Rohan, Simran, Kavya, Amit, Dev, Ishita, Shreya, Ratan, Varun, Manan, Sumit, Roopa, Kabir, Aayan, Shubh, Ashutosh, Advait, Amelia, Sophia
|
|
230
306
|
|
|
231
307
|
**Note:** Speaker selection must match the chosen model version.
|
|
232
308
|
|
|
233
309
|
pitch : typing.Optional[float]
|
|
234
310
|
Controls the pitch of the audio. Lower values result in a deeper voice, while higher values make it sharper. The suitable range is between -0.75 and 0.75. Default is 0.0.
|
|
235
311
|
|
|
312
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
313
|
+
|
|
236
314
|
pace : typing.Optional[float]
|
|
237
|
-
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster.
|
|
315
|
+
Controls the speed of the audio. Lower values result in slower speech, while higher values make it faster. Default is 1.0.
|
|
316
|
+
|
|
317
|
+
**Model-specific ranges:**
|
|
318
|
+
- **bulbul:v2:** 0.3 to 3.0
|
|
319
|
+
- **bulbul:v3-beta:** 0.5 to 2.0
|
|
238
320
|
|
|
239
321
|
loudness : typing.Optional[float]
|
|
240
322
|
Controls the loudness of the audio. Lower values result in quieter audio, while higher values make it louder. The suitable range is between 0.3 and 3.0. Default is 1.0.
|
|
241
323
|
|
|
324
|
+
**Note:** This parameter is only supported for bulbul:v2. It is NOT supported for bulbul:v3-beta and will cause a validation error if provided.
|
|
325
|
+
|
|
242
326
|
speech_sample_rate : typing.Optional[SpeechSampleRate]
|
|
243
|
-
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
327
|
+
Specifies the sample rate of the output audio. Supported values are 8000, 16000, 22050, 24000 Hz.
|
|
328
|
+
|
|
329
|
+
**Model-specific defaults:**
|
|
330
|
+
- **bulbul:v2:** Default is 22050 Hz
|
|
331
|
+
- **bulbul:v3-beta:** Default is 24000 Hz
|
|
244
332
|
|
|
245
333
|
enable_preprocessing : typing.Optional[bool]
|
|
246
|
-
|
|
334
|
+
Controls whether normalization of English words and numeric entities (e.g., numbers, dates) is performed. Set to true for better handling of mixed-language text.
|
|
335
|
+
|
|
336
|
+
**Model-specific behavior:**
|
|
337
|
+
- **bulbul:v2:** Default is false
|
|
338
|
+
- **bulbul:v3-beta:** Automatically enabled (true) and cannot be disabled
|
|
247
339
|
|
|
248
340
|
model : typing.Optional[TextToSpeechModel]
|
|
249
|
-
Specifies the model to use for text-to-speech conversion.
|
|
341
|
+
Specifies the model to use for text-to-speech conversion.
|
|
342
|
+
|
|
343
|
+
**Available models:**
|
|
344
|
+
- **bulbul:v2:** Default model with pitch, loudness controls
|
|
345
|
+
- **bulbul:v3-beta:** Newer model with temperature control, improved quality
|
|
250
346
|
|
|
251
347
|
output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
|
|
252
348
|
Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
|
|
253
349
|
|
|
350
|
+
temperature : typing.Optional[float]
|
|
351
|
+
Controls the randomness of the output. Lower values make the output more focused and deterministic, while higher values make it more random. The suitable range is between 0.01 and 1.0. Default is 0.6.
|
|
352
|
+
|
|
353
|
+
**Note:** This parameter is only supported for bulbul:v3-beta. It has no effect on bulbul:v2.
|
|
354
|
+
|
|
254
355
|
request_options : typing.Optional[RequestOptions]
|
|
255
356
|
Request-specific configuration.
|
|
256
357
|
|
|
@@ -274,6 +375,7 @@ class AsyncRawTextToSpeechClient:
|
|
|
274
375
|
"enable_preprocessing": enable_preprocessing,
|
|
275
376
|
"model": model,
|
|
276
377
|
"output_audio_codec": output_audio_codec,
|
|
378
|
+
"temperature": temperature,
|
|
277
379
|
},
|
|
278
380
|
headers={
|
|
279
381
|
"content-type": "application/json",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
from .types import TextToSpeechStreamingSendCompletionEvent
|
|
5
|
+
from .types import TextToSpeechStreamingModel, TextToSpeechStreamingSendCompletionEvent
|
|
6
6
|
|
|
7
|
-
__all__ = ["TextToSpeechStreamingSendCompletionEvent"]
|
|
7
|
+
__all__ = ["TextToSpeechStreamingModel", "TextToSpeechStreamingSendCompletionEvent"]
|
|
@@ -11,6 +11,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .raw_client import AsyncRawTextToSpeechStreamingClient, RawTextToSpeechStreamingClient
|
|
13
13
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
14
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
14
15
|
from .types.text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
15
16
|
|
|
16
17
|
try:
|
|
@@ -38,7 +39,7 @@ class TextToSpeechStreamingClient:
|
|
|
38
39
|
def connect(
|
|
39
40
|
self,
|
|
40
41
|
*,
|
|
41
|
-
model: typing.Optional[
|
|
42
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
42
43
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
43
44
|
api_subscription_key: typing.Optional[str] = None,
|
|
44
45
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -50,10 +51,16 @@ class TextToSpeechStreamingClient:
|
|
|
50
51
|
The Try It playground may not provide the best experience for streaming audio.
|
|
51
52
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
52
53
|
|
|
54
|
+
**Model-Specific Notes:**
|
|
55
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
56
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
57
|
+
|
|
53
58
|
Parameters
|
|
54
59
|
----------
|
|
55
|
-
model : typing.Optional[
|
|
56
|
-
Text to speech model to use
|
|
60
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
61
|
+
Text to speech model to use.
|
|
62
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
63
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
57
64
|
|
|
58
65
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
59
66
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -117,7 +124,7 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
117
124
|
async def connect(
|
|
118
125
|
self,
|
|
119
126
|
*,
|
|
120
|
-
model: typing.Optional[
|
|
127
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
121
128
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
122
129
|
api_subscription_key: typing.Optional[str] = None,
|
|
123
130
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -129,10 +136,16 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
129
136
|
The Try It playground may not provide the best experience for streaming audio.
|
|
130
137
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
131
138
|
|
|
139
|
+
**Model-Specific Notes:**
|
|
140
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
141
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
142
|
+
|
|
132
143
|
Parameters
|
|
133
144
|
----------
|
|
134
|
-
model : typing.Optional[
|
|
135
|
-
Text to speech model to use
|
|
145
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
146
|
+
Text to speech model to use.
|
|
147
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
148
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
136
149
|
|
|
137
150
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
138
151
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -10,6 +10,7 @@ from ..core.api_error import ApiError
|
|
|
10
10
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
13
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
13
14
|
from .types.text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
14
15
|
|
|
15
16
|
try:
|
|
@@ -26,7 +27,7 @@ class RawTextToSpeechStreamingClient:
|
|
|
26
27
|
def connect(
|
|
27
28
|
self,
|
|
28
29
|
*,
|
|
29
|
-
model: typing.Optional[
|
|
30
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
30
31
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
31
32
|
api_subscription_key: typing.Optional[str] = None,
|
|
32
33
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -38,10 +39,16 @@ class RawTextToSpeechStreamingClient:
|
|
|
38
39
|
The Try It playground may not provide the best experience for streaming audio.
|
|
39
40
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
40
41
|
|
|
42
|
+
**Model-Specific Notes:**
|
|
43
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
44
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
45
|
+
|
|
41
46
|
Parameters
|
|
42
47
|
----------
|
|
43
|
-
model : typing.Optional[
|
|
44
|
-
Text to speech model to use
|
|
48
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
49
|
+
Text to speech model to use.
|
|
50
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
51
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
45
52
|
|
|
46
53
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
47
54
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -94,7 +101,7 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
94
101
|
async def connect(
|
|
95
102
|
self,
|
|
96
103
|
*,
|
|
97
|
-
model: typing.Optional[
|
|
104
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
98
105
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
99
106
|
api_subscription_key: typing.Optional[str] = None,
|
|
100
107
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -106,10 +113,16 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
106
113
|
The Try It playground may not provide the best experience for streaming audio.
|
|
107
114
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
108
115
|
|
|
116
|
+
**Model-Specific Notes:**
|
|
117
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
118
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
119
|
+
|
|
109
120
|
Parameters
|
|
110
121
|
----------
|
|
111
|
-
model : typing.Optional[
|
|
112
|
-
Text to speech model to use
|
|
122
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
123
|
+
Text to speech model to use.
|
|
124
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
125
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
113
126
|
|
|
114
127
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
115
128
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|