The official C++ SDK for interacting with Camb AI's powerful voice and audio generation APIs. Create expressive speech, unique voices, and rich soundscapes with highly performant C++ applications.
- 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.
- Cross-Platform: Built using
cpprestsdkfor compatibility with Windows, Linux, and macOS.
- CMake (3.10+)
- C++ Compiler (C++11 or later)
- cpprestsdk (libcpprest-dev)
- Boost (libboost-all-dev)
- OpenSSL (libssl-dev)
# Clone the repository
git clone https://github.com/Camb-ai/cambai-cpp-sdk.git
cd cambai-cpp-sdk
# Create build directory
mkdir build && cd build
# Configure and Build
cmake ..
makeIf you are using CMake, you can add this SDK as a subdirectory or install it.
add_subdirectory(cambai-cpp-sdk)
target_link_libraries(your_app PRIVATE CppRestOpenAPIClient)To use the Camb AI SDK, you'll need an API key.
#include "CambAIClient.h"
int main() {
cambai::CambAIClient client("YOUR_CAMB_API_KEY");
// helper accessors
auto ttsApi = client.getTextToSpeechApi();
// ...
}You can swap the backend provider while keeping the unified interface.
#include "CambAIClient.h"
// Implementation of ITtsProvider for Baseten provided in examples
int main() {
cambai::CambAIClient client("KEY");
// Create custom provider wrapper
auto baseten = std::make_shared<BasetenProvider>("BASETEN_KEY", "MARS_URL");
// Swap provider
client.setTtsProvider(baseten);
// Unified call
client.tts()->tts(payload);
}NOTE: Check examples/ directory for full runnable files.
Convert text into spoken audio.
auto payload = std::make_shared<CreateTTSRequestPayload>();
payload->setText(utility::conversions::to_string_t("Hello World"));
payload->setVoiceId(20303);
payload->setLanguage(std::make_shared<Languages>(Languages::eLanguages::EN_US));
auto task = client.tts()->tts(payload);
auto result = task.get(); // Wait for Task IDCreate unique voices from description.
auto payload = std::make_shared<CreateTextToVoiceRequestPayload>();
payload->setText(utility::conversions::to_string_t("Voice description prompt..."));
payload->setAge(30);
auto task = client.getTextToVoiceApi()->createTextToVoiceTextToVoicePost(payload, boost::none);Generate sound effects.
auto payload = std::make_shared<CreateTextToAudioRequestPayload>();
payload->setPrompt(utility::conversions::to_string_t("Forest sounds"));
auto task = client.getTextToAudioApi()->createTextToAudioTextToAudioPost(payload);Dub videos.
auto payload = std::make_shared<EndToEndDubbingRequestPayload>();
payload->setVideoUrl(utility::conversions::to_string_t("..."));
payload->setSourceLanguage(Languages::eLanguages::EN_US);
// setTargetLanguages...
auto task = client.getDubApi()->createDubDubPost(payload);This project is licensed under the MIT License.
