Overview
The Camb.ai PHP SDK provides a simple interface to integrate high-quality text-to-speech into your applications. This quickstart will have you generating speech in under 5 minutes.Installation
Add the Camb.ai repository and package to yourcomposer.json:
Authentication
Get your API key from CAMB.AI Studio and set it as an environment variable:Quick Start
Streaming Text-to-Speech
Generate and stream speech in real-time:Using the Helper Function
You can easily wrap the file saving into a helper function: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
Camb.ai supports 140+ languages. Specify the language using theLanguages constants:
Languages supported by each model mentioned at MARS Models.
Error Handling
Handle common errors gracefully:Using Custom Provider
For more details check this guide Custom Cloud ProvidersBaseten 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