Integration with LiveKit is currently being reviewed
Overview
The livekit-plugins-camb package enables you to integrate Camb.ai’s MARS text-to-speech models into your LiveKit voice agents. This integration provides high-quality, low-latency voice synthesis for real-time conversational AI applications.Key Features
- MARS Models: Access to Camb.ai’s latest generation TTS models (mars-flash, mars-pro)
- Multilingual: Up to 312 languages depending on the MARS model — see Language Support
- Real-time Streaming: HTTP chunked streaming for low-latency audio
- Voice Customization: Voice selection and enhanced pronunciation for names/places
- Model-specific Sample Rates: 22.05kHz (mars-flash) or 48kHz (mars-pro)
Installation
Prerequisites
- Python 3.9 or higher
- A Camb.ai API key (get one here)
- LiveKit Cloud account or self-hosted LiveKit server
Install the Plugin
Quick Start
1. Set Up Environment Variables
Create a.env file in your project directory:
2. Create Your Voice Agent
3. Run Your Agent
Development mode (with LiveKit Agents Playground):Configuration
TTS Options
Thecamb.TTS class accepts the following parameters:
Available Models
- Fast (Recommended)
- High Quality
Language Support
Camb.ai supports up to 312 languages depending on the MARS model — see Language Support for the full per-model locale list. Specify the language using BCP-47 codes:Advanced Usage
Dynamic Option Updates
Update TTS settings during a session:Function Tools
Add custom capabilities to your agent using the@function_tool decorator. The LLM automatically discovers these functions and calls them based on user conversation.
Custom HTTP Session
For advanced use cases, provide your own aiohttp session:Metrics and Logging
Track usage and performance:Full Voice Agent Example
Here’s a full example combining all features.Installation
Code
Run
Development mode (opens playground in browser):Troubleshooting
Common Issues
Invalid API Key Error
Invalid API Key Error
Ensure your Or pass it directly:
CAMB_API_KEY environment variable is set correctly:Voice Not Found
Voice Not Found
The voice ID must be an integer. Use
list_voices() to find available voices:Timeout Errors
Timeout Errors
TTS synthesis can take time for longer texts. The plugin automatically uses a minimum 60-second timeout.For very long texts, consider breaking them into smaller chunks.
Audio Quality Issues
Audio Quality Issues
- Use
mars-profor highest quality (48kHz) ormars-flashfor best latency (22.05kHz) - Ensure your network connection is stable
- Use
pcm_s16leformat for lowest latency
Connection Errors
Connection Errors
Check that you can reach the Camb.ai API: