Python SDK Link: Camb AI Python SDK
Installation Command:Features:
- Dubbing: Dub your videos into multiple languages with voice cloning!
- Expressive Text-to-Speech: Convert text into natural-sounding speech using a wide range of pre-existing voices.
- Generative Voices: Create entirely new, unique voices from text prompts and descriptions.
- Soundscapes from Text: Generate ambient audio and sound effects from textual descriptions.
- Voice Cloning, Translation, and more (refer to full API documentation).
Directly Usable Examples: Camb AI Python SDK Examples
Core Components
1. AsyncCambAI (Asynchronous Client)
The non-blocking client built on httpx.AsyncClient and asyncio. Ideal for web servers (FastAPI, Sanic), real-time applications, and high-concurrency scenarios.
2. CambAI (Synchronous Client)
The standard blocking client. Use this for scripts, data processing pipelines, or applications where concurrency is managed via threads or isnβt a priority.
Supported Models & Architecture
MARS Pro (48kHz)
The flagship model. It consists of two main stages:- Prosody Model: Generates the rhythm, stress, and intonation of speech.
- Decoder: Converts these features into high-fidelity 48kHz audio.
MARS Flash (22.05kHz)
A distilled, faster version of MARS.- Lower Latency: optimized for near-real-time responses.
- Sample Rate: 22.05kHz.
MARS Instruct (22.05kHz)
Designed for fine-grained control over the output.- Instruction Following: Can take specific style or tone instructions.
Handling Streaming Responses
Both clients support streaming to handle large audio files efficiently or play audio as it generates.- Sync: Returns a standard
Iterator[bytes]. - Async: Returns an
AsyncIterator[bytes].
Private & Custom TTS Providers
The SDK supports routing Text-to-Speech generation requests to private or custom deployments of the MARS model. This is ideal for enterprise use cases requiring strict data privacy, dedicated throughput, or custom model fine-tuning.Supported Providers
- Baseten: For deployments on Baseten.co infrastructure.
- Vertex AI (In Progress): For deployments on Google Cloud Vertex AI.
Baseten Deployment
For Baseten, initialize the client with your API key and the specific model URL. Reference Example Link: Baseten Provider ExampleUsage Example
When using Baseten, passingreference_audio in the additional_body_parameters is required.
How it Works
- The SDK bypasses standard Camb AI API endpoints.
- It authenticates directly with Baseten using the provided API Key.
- It streams generated audio directly from the model instance.
Vertex AI Deployment
Support for Vertex AI is currently in progress.