camb-sdk 1.0.2__tar.gz → 1.0.3__tar.gz
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.
Potentially problematic release.
This version of camb-sdk might be problematic. Click here for more details.
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/PKG-INFO +38 -13
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/README.md +37 -12
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/camb_sdk.egg-info/PKG-INFO +38 -13
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/apis_api.py +16 -8
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/pyproject.toml +1 -1
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/LICENSE +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/camb_sdk.egg-info/SOURCES.txt +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/camb_sdk.egg-info/dependency_links.txt +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/camb_sdk.egg-info/requires.txt +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/camb_sdk.egg-info/top_level.txt +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/__init__.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/__init__.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/audio_separation_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/dictionaries_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/dub_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/stories_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/text_to_audio_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/text_to_speech_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api/text_to_voice_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api_client.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/api_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/configuration.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/exceptions.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/__init__.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/audio_output_file_url_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/audio_output_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/audio_separation_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/body_translate_translate_post.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_api_key_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_custom_voice_out.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_text_to_audio_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_text_to_voice_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_translated_story_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_translated_tts_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_translation_stream_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_tts_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_tts_stream_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/dialogue_item.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/dictionary.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/dub_alt_format_response_body.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/dubbed_output_in_alt_format_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/end_to_end_dubbing_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/expire_api_key_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/formalities.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/gender.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/http_validation_error.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/language_item.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/languages.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/orchestrator_pipeline_result.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/output_api_key.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/output_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/output_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/request_dubbed_output_in_alt_format200_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/story_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/task_id.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/task_status.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/text_to_voice_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/transcript_data_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/transcript_file_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/translation_result.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/tts_stream_output_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/validation_error.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/validation_error_loc_inner.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/video_output_type_without_avi.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/voice_item.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/py.typed +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/rest.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/setup.cfg +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_apis_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_audio_output_file_url_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_audio_output_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_audio_separation_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_audio_separation_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_body_translate_translate_post.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_api_key_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_custom_voice_out.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_text_to_audio_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_text_to_voice_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_translated_story_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_translated_tts_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_translation_stream_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_tts_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_create_tts_stream_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dialogue_item.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dictionaries_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dictionary.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dub_alt_format_response_body.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dub_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_dubbed_output_in_alt_format_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_end_to_end_dubbing_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_expire_api_key_request_payload.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_formalities.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_gender.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_http_validation_error.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_language_item.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_languages.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_orchestrator_pipeline_result.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_output_api_key.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_output_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_output_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_request_dubbed_output_in_alt_format200_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_stories_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_story_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_task_id.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_task_status.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_text_to_audio_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_text_to_speech_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_text_to_voice_api.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_text_to_voice_run_info_response.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_transcript_data_type.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_transcript_file_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_translation_result.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_tts_stream_output_format.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_validation_error.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_validation_error_loc_inner.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_video_output_type_without_avi.py +0 -0
- {camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_voice_item.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camb-sdk
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Camb AI Python SDK for Text-to-Speech, Voice Generation, and Audio APIs
|
|
5
5
|
Author-email: Camb AI <support@camb.ai>
|
|
6
6
|
License: MIT
|
|
@@ -162,9 +162,10 @@ output_file = "generated_voice_output.mp3"
|
|
|
162
162
|
try:
|
|
163
163
|
print("Generating a new voice and speech...")
|
|
164
164
|
# The 'text_to_voice' method returns a dict consisting of 3 sample URLs
|
|
165
|
+
# Description and Text should be atleast 100 Characters.
|
|
165
166
|
result = client.text_to_voice(
|
|
166
|
-
text="Crafting a unique voice
|
|
167
|
-
voice_description="A smooth, baritone voice with a
|
|
167
|
+
text="Crafting a truly unique and captivating voice that carries a subtle air of mystery, depth, and gentle warmth.",
|
|
168
|
+
voice_description="A smooth, rich baritone voice layered with a soft echo, ideal for immersive storytelling and emotional depth.",
|
|
168
169
|
verbose=True
|
|
169
170
|
)
|
|
170
171
|
print(result)
|
|
@@ -190,7 +191,7 @@ output_file = "generated_sound_effect.mp3"
|
|
|
190
191
|
try:
|
|
191
192
|
print(f"Generating sound effect and saving to {output_file}...")
|
|
192
193
|
|
|
193
|
-
client.
|
|
194
|
+
client.text_to_sound(
|
|
194
195
|
prompt="A gentle breeze rustling through autumn leaves in a quiet forest.",
|
|
195
196
|
duration=10,
|
|
196
197
|
save_to_file=output_file,
|
|
@@ -199,13 +200,13 @@ try:
|
|
|
199
200
|
print(f"Success! Sound effect saved to {output_file}")
|
|
200
201
|
|
|
201
202
|
except ApiException as e:
|
|
202
|
-
print(f"API Exception when calling
|
|
203
|
+
print(f"API Exception when calling text_to_sound: {e}\n")
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
---
|
|
206
|
-
### 4.
|
|
207
|
+
### 4. Getting Client Source and Target Languages
|
|
207
208
|
|
|
208
|
-
|
|
209
|
+
Retrieve available source and target languages for translation and dubbing.
|
|
209
210
|
|
|
210
211
|
```python
|
|
211
212
|
from cambai import CambAI
|
|
@@ -214,12 +215,36 @@ from cambai.rest import ApiException
|
|
|
214
215
|
# Initialize client
|
|
215
216
|
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
try:
|
|
219
|
+
# Get all available target languages
|
|
220
|
+
print("Listing target languages...")
|
|
221
|
+
target_languages = client.get_target_languages()
|
|
222
|
+
print(f"Found {len(target_languages)} target languages:")
|
|
223
|
+
for language in target_languages:
|
|
224
|
+
print(f" - {language}")
|
|
225
|
+
|
|
226
|
+
# Get all available source languages
|
|
227
|
+
print("\nListing source languages...")
|
|
228
|
+
source_languages = client.get_source_languages()
|
|
229
|
+
print(f"Found {len(source_languages)} source languages:")
|
|
230
|
+
for language in source_languages:
|
|
231
|
+
print(f" - {language}")
|
|
232
|
+
|
|
233
|
+
except ApiException as e:
|
|
234
|
+
print(f"API Exception when getting languages: {e}\n")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
### 5. End-to-End Dubbing
|
|
239
|
+
|
|
240
|
+
Dub videos into different languages with voice cloning and translation capabilities.
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
from cambai import CambAI
|
|
244
|
+
from cambai.rest import ApiException
|
|
245
|
+
|
|
246
|
+
# Initialize client
|
|
247
|
+
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
223
248
|
|
|
224
249
|
try:
|
|
225
250
|
print("Starting end-to-end dubbing process...")
|
|
@@ -144,9 +144,10 @@ output_file = "generated_voice_output.mp3"
|
|
|
144
144
|
try:
|
|
145
145
|
print("Generating a new voice and speech...")
|
|
146
146
|
# The 'text_to_voice' method returns a dict consisting of 3 sample URLs
|
|
147
|
+
# Description and Text should be atleast 100 Characters.
|
|
147
148
|
result = client.text_to_voice(
|
|
148
|
-
text="Crafting a unique voice
|
|
149
|
-
voice_description="A smooth, baritone voice with a
|
|
149
|
+
text="Crafting a truly unique and captivating voice that carries a subtle air of mystery, depth, and gentle warmth.",
|
|
150
|
+
voice_description="A smooth, rich baritone voice layered with a soft echo, ideal for immersive storytelling and emotional depth.",
|
|
150
151
|
verbose=True
|
|
151
152
|
)
|
|
152
153
|
print(result)
|
|
@@ -172,7 +173,7 @@ output_file = "generated_sound_effect.mp3"
|
|
|
172
173
|
try:
|
|
173
174
|
print(f"Generating sound effect and saving to {output_file}...")
|
|
174
175
|
|
|
175
|
-
client.
|
|
176
|
+
client.text_to_sound(
|
|
176
177
|
prompt="A gentle breeze rustling through autumn leaves in a quiet forest.",
|
|
177
178
|
duration=10,
|
|
178
179
|
save_to_file=output_file,
|
|
@@ -181,13 +182,13 @@ try:
|
|
|
181
182
|
print(f"Success! Sound effect saved to {output_file}")
|
|
182
183
|
|
|
183
184
|
except ApiException as e:
|
|
184
|
-
print(f"API Exception when calling
|
|
185
|
+
print(f"API Exception when calling text_to_sound: {e}\n")
|
|
185
186
|
```
|
|
186
187
|
|
|
187
188
|
---
|
|
188
|
-
### 4.
|
|
189
|
+
### 4. Getting Client Source and Target Languages
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
Retrieve available source and target languages for translation and dubbing.
|
|
191
192
|
|
|
192
193
|
```python
|
|
193
194
|
from cambai import CambAI
|
|
@@ -196,12 +197,36 @@ from cambai.rest import ApiException
|
|
|
196
197
|
# Initialize client
|
|
197
198
|
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
198
199
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
try:
|
|
201
|
+
# Get all available target languages
|
|
202
|
+
print("Listing target languages...")
|
|
203
|
+
target_languages = client.get_target_languages()
|
|
204
|
+
print(f"Found {len(target_languages)} target languages:")
|
|
205
|
+
for language in target_languages:
|
|
206
|
+
print(f" - {language}")
|
|
207
|
+
|
|
208
|
+
# Get all available source languages
|
|
209
|
+
print("\nListing source languages...")
|
|
210
|
+
source_languages = client.get_source_languages()
|
|
211
|
+
print(f"Found {len(source_languages)} source languages:")
|
|
212
|
+
for language in source_languages:
|
|
213
|
+
print(f" - {language}")
|
|
214
|
+
|
|
215
|
+
except ApiException as e:
|
|
216
|
+
print(f"API Exception when getting languages: {e}\n")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
### 5. End-to-End Dubbing
|
|
221
|
+
|
|
222
|
+
Dub videos into different languages with voice cloning and translation capabilities.
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
from cambai import CambAI
|
|
226
|
+
from cambai.rest import ApiException
|
|
227
|
+
|
|
228
|
+
# Initialize client
|
|
229
|
+
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
205
230
|
|
|
206
231
|
try:
|
|
207
232
|
print("Starting end-to-end dubbing process...")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camb-sdk
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Camb AI Python SDK for Text-to-Speech, Voice Generation, and Audio APIs
|
|
5
5
|
Author-email: Camb AI <support@camb.ai>
|
|
6
6
|
License: MIT
|
|
@@ -162,9 +162,10 @@ output_file = "generated_voice_output.mp3"
|
|
|
162
162
|
try:
|
|
163
163
|
print("Generating a new voice and speech...")
|
|
164
164
|
# The 'text_to_voice' method returns a dict consisting of 3 sample URLs
|
|
165
|
+
# Description and Text should be atleast 100 Characters.
|
|
165
166
|
result = client.text_to_voice(
|
|
166
|
-
text="Crafting a unique voice
|
|
167
|
-
voice_description="A smooth, baritone voice with a
|
|
167
|
+
text="Crafting a truly unique and captivating voice that carries a subtle air of mystery, depth, and gentle warmth.",
|
|
168
|
+
voice_description="A smooth, rich baritone voice layered with a soft echo, ideal for immersive storytelling and emotional depth.",
|
|
168
169
|
verbose=True
|
|
169
170
|
)
|
|
170
171
|
print(result)
|
|
@@ -190,7 +191,7 @@ output_file = "generated_sound_effect.mp3"
|
|
|
190
191
|
try:
|
|
191
192
|
print(f"Generating sound effect and saving to {output_file}...")
|
|
192
193
|
|
|
193
|
-
client.
|
|
194
|
+
client.text_to_sound(
|
|
194
195
|
prompt="A gentle breeze rustling through autumn leaves in a quiet forest.",
|
|
195
196
|
duration=10,
|
|
196
197
|
save_to_file=output_file,
|
|
@@ -199,13 +200,13 @@ try:
|
|
|
199
200
|
print(f"Success! Sound effect saved to {output_file}")
|
|
200
201
|
|
|
201
202
|
except ApiException as e:
|
|
202
|
-
print(f"API Exception when calling
|
|
203
|
+
print(f"API Exception when calling text_to_sound: {e}\n")
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
---
|
|
206
|
-
### 4.
|
|
207
|
+
### 4. Getting Client Source and Target Languages
|
|
207
208
|
|
|
208
|
-
|
|
209
|
+
Retrieve available source and target languages for translation and dubbing.
|
|
209
210
|
|
|
210
211
|
```python
|
|
211
212
|
from cambai import CambAI
|
|
@@ -214,12 +215,36 @@ from cambai.rest import ApiException
|
|
|
214
215
|
# Initialize client
|
|
215
216
|
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
try:
|
|
219
|
+
# Get all available target languages
|
|
220
|
+
print("Listing target languages...")
|
|
221
|
+
target_languages = client.get_target_languages()
|
|
222
|
+
print(f"Found {len(target_languages)} target languages:")
|
|
223
|
+
for language in target_languages:
|
|
224
|
+
print(f" - {language}")
|
|
225
|
+
|
|
226
|
+
# Get all available source languages
|
|
227
|
+
print("\nListing source languages...")
|
|
228
|
+
source_languages = client.get_source_languages()
|
|
229
|
+
print(f"Found {len(source_languages)} source languages:")
|
|
230
|
+
for language in source_languages:
|
|
231
|
+
print(f" - {language}")
|
|
232
|
+
|
|
233
|
+
except ApiException as e:
|
|
234
|
+
print(f"API Exception when getting languages: {e}\n")
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
### 5. End-to-End Dubbing
|
|
239
|
+
|
|
240
|
+
Dub videos into different languages with voice cloning and translation capabilities.
|
|
241
|
+
|
|
242
|
+
```python
|
|
243
|
+
from cambai import CambAI
|
|
244
|
+
from cambai.rest import ApiException
|
|
245
|
+
|
|
246
|
+
# Initialize client
|
|
247
|
+
client = CambAI(api_key="YOUR_CAMB_API_KEY")
|
|
223
248
|
|
|
224
249
|
try:
|
|
225
250
|
print("Starting end-to-end dubbing process...")
|
|
@@ -15,7 +15,7 @@ import time
|
|
|
15
15
|
import warnings
|
|
16
16
|
import json
|
|
17
17
|
# Constants for API operations
|
|
18
|
-
TIMEOUT =
|
|
18
|
+
TIMEOUT = 120
|
|
19
19
|
POLL_INTERVAL = 5
|
|
20
20
|
|
|
21
21
|
from cambai.configuration import Configuration
|
|
@@ -74,7 +74,7 @@ class CambAI:
|
|
|
74
74
|
self.api_client = api_client
|
|
75
75
|
|
|
76
76
|
@validate_call
|
|
77
|
-
def
|
|
77
|
+
def text_to_sound(
|
|
78
78
|
self,
|
|
79
79
|
prompt: str,
|
|
80
80
|
duration: int,
|
|
@@ -90,7 +90,7 @@ class CambAI:
|
|
|
90
90
|
Args:
|
|
91
91
|
prompt: The text prompt to convert to audio
|
|
92
92
|
duration: The desired duration of the audio in seconds
|
|
93
|
-
timeout: Maximum time to wait for processing in seconds (default:
|
|
93
|
+
timeout: Maximum time to wait for processing in seconds (default: 120)
|
|
94
94
|
save_to_file: Optional file path to save the audio to
|
|
95
95
|
verbose: Whether to print status updates during processing
|
|
96
96
|
|
|
@@ -104,7 +104,7 @@ class CambAI:
|
|
|
104
104
|
IOError: If there's an error saving the file
|
|
105
105
|
"""
|
|
106
106
|
from cambai.models.create_text_to_audio_request_payload import CreateTextToAudioRequestPayload
|
|
107
|
-
|
|
107
|
+
assert(len(prompt) <= 30)
|
|
108
108
|
# Create the request payload
|
|
109
109
|
request_payload = CreateTextToAudioRequestPayload(
|
|
110
110
|
prompt=prompt,
|
|
@@ -186,7 +186,7 @@ class CambAI:
|
|
|
186
186
|
Args:
|
|
187
187
|
text: The text to convert to speech
|
|
188
188
|
voice_description: Description of the voice to generate
|
|
189
|
-
timeout: Maximum time to wait for processing in seconds (default:
|
|
189
|
+
timeout: Maximum time to wait for processing in seconds (default: 120)
|
|
190
190
|
verbose: Whether to print status updates during processing
|
|
191
191
|
|
|
192
192
|
Returns:
|
|
@@ -197,7 +197,7 @@ class CambAI:
|
|
|
197
197
|
TimeoutError: If the processing doesn't complete within the timeout period
|
|
198
198
|
"""
|
|
199
199
|
from cambai.models.create_text_to_voice_request_payload import CreateTextToVoiceRequestPayload
|
|
200
|
-
|
|
200
|
+
assert(len(text) >= 100)
|
|
201
201
|
# Create the request payload
|
|
202
202
|
request_payload = CreateTextToVoiceRequestPayload(
|
|
203
203
|
text=text,
|
|
@@ -272,7 +272,7 @@ class CambAI:
|
|
|
272
272
|
text: The text to convert to speech
|
|
273
273
|
voice_id: The ID of the voice to use
|
|
274
274
|
language: The language ID (default: 1)
|
|
275
|
-
timeout: Maximum time to wait for processing in seconds (default:
|
|
275
|
+
timeout: Maximum time to wait for processing in seconds (default: 120)
|
|
276
276
|
output_type: Type of output to return (default: FILE_URL)
|
|
277
277
|
save_to_file: Optional file path to save the audio to (works with BYTES output type)
|
|
278
278
|
verbose: Whether to print status updates during processing
|
|
@@ -385,7 +385,7 @@ class CambAI:
|
|
|
385
385
|
target_languages: The list of desired languages that the media file will be dubbed to
|
|
386
386
|
selected_audio_tracks: Optional array of one or two zero-based audio track indices to dub. Only supported for MXF files. If omitted, the first audio track (index 0) is used by default.
|
|
387
387
|
add_output_as_an_audio_track: Whether to add the output as an audio track in the MXF file. Only supported for MXF files.
|
|
388
|
-
timeout: Maximum time to wait for processing in seconds (default:
|
|
388
|
+
timeout: Maximum time to wait for processing in seconds (default: 180)
|
|
389
389
|
verbose: Whether to print status updates during processing
|
|
390
390
|
|
|
391
391
|
Returns:
|
|
@@ -440,6 +440,12 @@ class CambAI:
|
|
|
440
440
|
response = self.get_dubbed_run_info_by_id(result.run_id)
|
|
441
441
|
return response
|
|
442
442
|
|
|
443
|
+
elif result.status == 'FAILED' or result.status == 'ERROR':
|
|
444
|
+
error_msg = f"End-to-end dubbing failed with status: {result.status}"
|
|
445
|
+
if verbose:
|
|
446
|
+
print(error_msg)
|
|
447
|
+
raise RuntimeError(error_msg)
|
|
448
|
+
|
|
443
449
|
elif verbose:
|
|
444
450
|
print(f"Still processing... (status: {result.status})")
|
|
445
451
|
|
|
@@ -447,6 +453,8 @@ class CambAI:
|
|
|
447
453
|
except Exception as e:
|
|
448
454
|
if verbose:
|
|
449
455
|
print(f"Error checking status: {str(e)}")
|
|
456
|
+
# Re-raise the exception to stop polling on error
|
|
457
|
+
raise
|
|
450
458
|
|
|
451
459
|
# Wait before next poll
|
|
452
460
|
time.sleep(POLL_INTERVAL)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/create_translation_stream_request_payload.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/dubbed_output_in_alt_format_request_payload.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{camb_sdk-1.0.2 → camb_sdk-1.0.3}/cambai/models/request_dubbed_output_in_alt_format200_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{camb_sdk-1.0.2 → camb_sdk-1.0.3}/test/test_request_dubbed_output_in_alt_format200_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|