Overview
The Camb.ai C++ SDK provides a high-performance interface to integrate text-to-speech into your applications. This quickstart will have you generating speech in under 5 minutes.Installation
Prerequisites
- CMake (3.10+)
- cpprestsdk (libcpprest-dev)
- Boost (libboost-all-dev)
- OpenSSL (libssl-dev)
Installation Steps
- Clone the repository:
- Add to your
CMakeLists.txt:
Authentication
Get your API key from CAMB.AI Studio and initialize the client:Quick Start
Streaming Text-to-Speech
Generate speech and handle the response stream. This example shows how to initiate the request:Choosing a Model
Camb.ai offers three MARS models optimized for different use cases:MARS Flash
Sample rate: 22.05kHz
MARS Pro
Sample rate: 48kHz
MARS Instruct
Sample rate: 22.05kHz
Listing Available Voices
Discover available voices for your application:Language Support
Specify the language using theLanguages enum wrapper:
Error Handling
The SDK uses asynchronous tasks (pplx::task). Use .get() within a try-catch block to handle errors:
Using Custom Provider
Baseten Deployment
Initialize the client with your custom provider implementation. Baseten Provider ExampleNext Steps
Voice Agents
Build real-time voice agents with Pipecat
LiveKit Integration
Create voice agents with LiveKit
API Reference
Explore the full TTS API
Voice Library
Browse available voices