Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.camb.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Translate the audio of any video into another language while preserving the original speaker’s voice characteristics. Dubbing is useful for content localization, accessibility, and reaching global audiences without re-recording. The dubbing pipeline is asynchronous: you submit a job, poll until it completes, then retrieve the dubbed output.

Prerequisites

1

Create an account

Sign up at CAMB.AI Studio if you haven’t already.
2

Get your API key

Go to Settings → API Keys in Studio and copy your key. See Authentication for details.
3

Install the SDK

pip install camb-sdk
Skip this step if you’re using the direct API.
4

Set your API key to use in your code

export CAMB_API_KEY="your_api_key_here"

Code

import os
import time
from camb.client import CambAI
from camb.types.language_enums import Languages

client = CambAI(api_key=os.getenv("CAMB_API_KEY"))

def dub_video():
    # Step 1: Submit the dubbing job
    response = client.dub.create_dub(
        video_url="https://www.youtube.com/watch?v=your-video-id",
        source_language=Languages.EN_US,
        target_language=Languages.HI_IN
    )

    task_id = response.task_id
    print(f"Dubbing task created: {task_id}")

    # Step 2: Poll until complete
    while True:
        status = client.dub.get_dubbing_status(task_id=task_id)
        print(f"Status: {status.status}")

        if status.status == "SUCCESS":
            # Step 3: Retrieve the dubbed output
            result = client.dub.get_dubbed_run_info(status.run_id)
            print(f"Audio URL: {result.audio_url}")
            print(f"Video URL: {result.video_url}")
            break
        elif status.status == "ERROR":
            print(f"Dubbing failed: {status.exception_reason}")
            break

        time.sleep(5)

dub_video()

Parameters

Required

ParameterTypeDescription
video_urlstringPublicly accessible URL of the source video (YouTube links and direct URLs are supported)
source_languageLanguages enumLanguage spoken in the source video
target_languageLanguages enumLanguage to dub into

Optional

ParameterTypeDescription
target_languagesLanguages[]Dub into multiple languages in a single job
project_namestringLabel for the job in your dashboard
project_descriptionstringAdditional notes for the job
ai_optimizationbooleanEnable AI-based quality optimization
selected_audio_tracksinteger[]Specific audio track indices from the source video
add_output_as_an_audio_trackbooleanAttach the dubbed audio as an extra track instead of replacing the original

Language Enum

Use the Languages enum (Python) or CambApi.Languages (TypeScript) to specify languages:
from camb.types.language_enums import Languages

# Examples
Languages.EN_US   # English (US)
Languages.ES_ES   # Spanish (Spain)
Languages.FR_FR   # French
Languages.DE_DE   # German
Languages.HI_IN   # Hindi
Languages.JA_JP   # Japanese
Languages.ZH_CN   # Chinese (Simplified)

Tips

  • Video URL: The URL must be publicly accessible. YouTube video links and direct file URLs (MP4, WebM) are both supported.
  • Polling timeout: For long videos, cap your polling loop (e.g. 60 attempts × 5s = 5 minutes) and handle the timeout gracefully.
  • Multiple targets: Pass target_languages as an array to dub into several languages in a single job, which is more efficient than submitting separate jobs.
  • Transcripts: The result object includes a transcript field with per-segment timing data, useful for subtitle generation.

Next Steps

End-to-End Dubbing API

Full API reference for the dubbing endpoint.

Get Dubbing Status

Status polling endpoint reference.

Get Dubbed Run Info

Retrieve the dubbed output URLs and transcript.

Voice Cloning

Clone a custom voice for use in speech generation.