From 7bbefba24ef3bcfbc9a74c2beef9bb7bd412e466 Mon Sep 17 00:00:00 2001 From: Chandrashekhar R <73425927+cr2007@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:52:15 +0400 Subject: [PATCH] Update `README` to link examples and remove inline examples * Simplified the README by removing inline TTS and Dubbing examples * Added a reference to the examples directory for usage instructions --- README.md | 81 +------------------------------------------------------ 1 file changed, 1 insertion(+), 80 deletions(-) diff --git a/README.md b/README.md index 3d9bf86..fa535fb 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ This is a Python wrapper for the CambAI API. It is designed to make it easy to i - [Installation](#installation) - [Usage](#usage) - - [TTS](#tts) - - [Dubbing](#dubbing) ## Installation @@ -29,81 +27,4 @@ pip install cambai ## Usage -### TTS - -```python -from cambai import CambAI, Gender -from dotenv import load_dotenv - -load_dotenv() - -def main(): - client = CambAI() - client.get_all_voices(write_to_file=True) # Set 'write_to_file' to False if you don't want to view the list of voices in a JSON file - - client.tts( - text="Hello, World!", - language=1, - gender=Gender.MALE, - age=25, - voice_id=, - debug=True, - polling_interval=3 - ) - -if __name__ == "__main__": - main() -``` - -Output: -``` -Voices written to voices.json -Starting TTS process - -TTS Task Started: {'task_id': 'de2668c5-b975-4887-8738-3afdf9f5cea6'} - -TTS Status: PENDING, Run ID: None -Sleeping for 3 seconds -Waiting 3 seconds before checking status again: 100%|████████████| 3/3 [00:03<00:00, 1.00s/s] -TTS Status: PENDING, Run ID: None -Sleeping for 3 seconds -Waiting 3 seconds before checking status again: 100%|████████████| 3/3 [00:03<00:00, 1.00s/s] -... -TTS Status: SUCCESS, Run ID: 12012 - -TTS audio written to 'audio_tts/tts_stream_12012.wav' -``` - -### Dubbing - -```python -from cambai import CambAI -from dotenv import load_dotenv -from rich import print - -load_dotenv() - -def main(): - print("Starting...") - client = CambAI() - - ## Dubbing example - - # You can get the list of source and target languages by calling the 'get_languages' method - client.get_languages("source", write_to_file=True) - - print("Sending URL") - values = client.dub( - video_url="", # Insert any public accessible URL here (e.g. YouTube, Vimeo, etc.) - source_language=1, # English (United States) - target_language=76, # French (France) - debug=True, # Set to False to not view the debug print statements - polling_interval=10 # Set the interval to check the status of the dubbing task - ) - - print(f"Output Video URL: {values["video_url"]}") - print(f"Output Audio URL: {values["audio_url"]}") - -if __name__ == "__main__": - main() -``` +Checkout the '[**examples**](./examples/)' directory for examples on how to use the CambAI API Wrapper.