> ## 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.

# End to End Dubbing

> Initiate a full end to end dubbing task.

Transform your media content for global audiences with our comprehensive dubbing solution. This powerful endpoint automates the entire dubbing process, taking your original media and producing a version that speaks naturally in your target language. The system handles everything from transcription to voice synthesis, delivering professional-quality results without requiring specialized audio engineering knowledge.

## The Dubbing Process

When you submit a dubbing request, our system begins a multi-stage workflow:

<Steps>
  <Step title="Project Setup">
    Our intelligent system works its magic behind the scenes to prepare your content for flawless localization.
  </Step>

  <Step title="Translation">
    The transcribed text is expertly translated to your target language using our proprietary translation engine [BOLI](https://www.camb.ai/#Research).
  </Step>

  <Step title="Voiceover Generation">
    Voiceovers are created using natural-sounding synthetic voices using our in-house novel speech model [MARS](https://www.camb.ai/#Research).
  </Step>

  <Step title="Final Assembly">
    Everything is combined into a seamless final product.
  </Step>
</Steps>

Throughout this process, you can check on your task's progress using the [`/dub/{task_id}`](get-end-to-end-dubbing-status) endpoint with the `task_id` provided in your initial response.

## Compatible Media Sources

Our dubbing service accommodates various media sources to fit your workflow needs. The `video_url` parameter in your request can point to any of the following:

### Online Platforms

Use content directly from popular content platforms:

* **YouTube videos**: Simply provide the standard YouTube video URL.
* **Google Drive**: Link to media files stored in Google Drive (ensure they're publicly accessible).
* **Direct URLs**: Any direct link to a media file that doesn't require authentication.

### Supported File Formats

Our system processes a wide range of professional and consumer media formats:

| Media Type  | Supported Formats   |
| :---------- | :------------------ |
| Video Files | MP4, MOV, MXF       |
| Audio Files | MP3, FLAC, WAV, AAC |

This flexibility allows you to work with both broadcast-quality content and consumer-grade media without conversion hassles.

<Info>Please note that MXF format support is exclusively available to customers on our Enterprise plan, offering professional broadcast-quality media handling for organizations with advanced needs.</Info>

## Language Configuration

Specifying the right languages is crucial for successful dubbing. Your request needs to include:

* **Source Language**: The original language spoken in your media.
* **Target Language(s)**: The language(s) you want your content to be dubbed into.

Both parameters require specific language identifiers from our system. To find the correct IDs:

1. Query the [`/source-languages`](get-source-languages) endpoint for available source language options.
2. Check the [`/target-languages`](get-target-languages) endpoint for supported target languages.

Using these official IDs ensures our system correctly processes your content.

## Creating Your First Dubbing request

Let's look at how to initiate a dubbing task with Python:

```python [expandable] theme={null}
import requests
import json
import time

# Your API authentication
headers = {
    "x-api-key": "your-api-key",  # Replace with your actual API key
    "Content-Type": "application/json"
}

# Define your dubbing request parameters
dubbing_request = {
    "video_url": "https://www.youtube.com/watch?v=exampleVideo",  # Your media URL
    "source_language": 1,      # Example: English (check /source-languages for IDs)
    "target_languages": [5],   # Example: Spanish (check /target-languages for IDs)
}

# Submit the dubbing request
def submit_dubbing_task(payload):
    """
    Submits a new dubbing task and returns the task ID for tracking.
    """
    try:
        response = requests.post(
            "https://client.camb.ai/apis/dub",
            headers=headers,
            data=json.dumps(payload)
        )

        # Verify the request was successful
        response.raise_for_status()

        # Extract the task ID from the response
        result = response.json()
        task_id = result.get("task_id")

        print(f"Dubbing task submitted successfully! Task ID: {task_id}")
        return task_id

    except requests.exceptions.RequestException as e:
        print(f"Error submitting dubbing task: {e}")
        if hasattr(e, 'response') and e.response is not None:
            print(f"Response content: {e.response.text}")
        return None

# Call the function to submit your dubbing task
task_id = submit_dubbing_task(dubbing_request)
```

## Monitoring Your Dubbing Progress

After submission, your content enters our processing pipeline. The time required depends on the length and complexity of your media. You can check progress by polling the status endpoint:

```python [expandable] theme={null}
def check_dubbing_status(task_id):
    """
    Checks the status of a dubbing task.
    Returns the current status and any available result information.
    """
    if not task_id:
        print("No task ID provided.")
        return None

    try:
        response = requests.get(
            f"https://client.camb.ai/apis/dub/{task_id}",
            headers=headers
        )

        # Verify the request was successful
        response.raise_for_status()

        # Parse the status information
        status_data = response.json()
        print(f"Current status: {status_data['status']}")

        return status_data

    except requests.exceptions.RequestException as e:
        print(f"Error checking dubbing status: {e}")
        return None

# Check the status of your task
status_info = check_dubbing_status(task_id)
```

## Best Practices for Optimal Results

To get the most from our dubbing service, consider these professional tips:

1. **Source Quality Matters**: Higher quality original media yields better dubbing results.
2. **Language Selection**: Choose the right language for your audience to ensure clarity and authenticity.

## Practical Applications

Our end-to-end dubbing functionality opens exciting possibilities across industries:

* **E-Learning**: Make educational content accessible to global learners.
* **Marketing**: Localize promotional videos for international markets.
* **Entertainment**: Bring films and shows to new language audiences.
* **Corporate Communications**: Ensure company messages reach multilingual teams.
* **Social Media**: Expand your content's reach across language barriers.

By integrating this API into your workflow, you can dramatically reduce the time and expense traditionally associated with professional dubbing while maintaining impressive quality.


## OpenAPI

````yaml post /dub
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /dub:
    post:
      tags:
        - Apis
      summary: End To End Dubbing
      description: Initiate a full end to end dubbing task.
      operationId: dub_dub_post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EndToEndDubbingRequestPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskID'
                description: >-
                  A JSON that contains the unique identifier for the task. This
                  is used to query the status of the end to end dubbing task
                  that is running. It is returned when a create request is made
                  for a dub
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    EndToEndDubbingRequestPayload:
      allOf:
        - $ref: '#/components/schemas/CreateTaskWithNameAndDescription'
        - properties:
            video_url:
              type: string
              title: Video Url
              description: >-
                The URL of the media file to be used to create the end-to-end
                dubbing task.
            source_language:
              $ref: '#/components/schemas/SourceLanguages'
              description: >-
                The original language of the media file to be used to create the
                end-to-end dubbing task.
            target_languages:
              items:
                $ref: '#/components/schemas/Languages'
              type: array
              description: >-
                The list of desired languages that the media file will be dubbed
                to.
            selected_audio_tracks:
              items:
                type: integer
                required: true
              type: array
              nullable: true
              description: >-
                Optional array of one or two zero‑based audio track indices to
                dub. Only supported for `MXF` files. If omitted, the first audio
                track (index 0) is used by default.
              minItems: 1
              maxItems: 2
              default: null
            add_output_as_an_audio_track:
              type: boolean
              nullable: true
              default: null
              description: >-
                Optional flag to append the dubbed audio as a new audio track in
                the output file. Only supported for `MXF` files. If `true`, the
                dubbed audio is added as an additional track; if `false` or
                omitted, the source would be returned with only dubbed audio.
            chosen_dictionaries:
              $ref: '#/components/schemas/ChosenDictionariesSchema'
          type: object
          required:
            - video_url
            - source_language
            - target_languages
      title: EndToEndDubbingRequestPayload
    TaskID:
      properties:
        task_id:
          type: string
          title: Task ID
      type: object
      title: Task ID
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateTaskWithNameAndDescription:
      properties:
        project_name:
          type: string
          title: Project Name
          description: >-
            Enter a distinctive name for your project that reflects its purpose
            or content. This name will be displayed in your CAMB.AI workspace
            dashboard and used to organize related assets, transcriptions, etc..
            . Choose something memorable that helps you quickly identify this
            specific project among your other voice, audio and localization
            tasks.
          minLength: 3
          maxLength: 255
          nullable: true
        project_description:
          type: string
          title: Project Description
          description: >-
            Provide details about your project's goals and specifications.
            Include information such as the target languages for translation or
            dubbing, desired voice characteristics, emotional tones to capture,
            or specific audio processing requirements, outlining the workflow
            here can serve as valuable documentation for organizational
            purposes.
          minLength: 3
          maxLength: 5000
          nullable: true
    SourceLanguages:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
        - 27
        - 28
        - 29
        - 30
        - 31
        - 32
        - 33
        - 34
        - 35
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
        - 45
        - 46
        - 47
        - 48
        - 49
        - 50
        - 51
        - 52
        - 53
        - 54
        - 55
        - 56
        - 57
        - 58
        - 59
        - 60
        - 61
        - 62
        - 63
        - 64
        - 65
        - 66
        - 67
        - 68
        - 69
        - 70
        - 71
        - 73
        - 74
        - 75
        - 76
        - 78
        - 79
        - 80
        - 81
        - 82
        - 83
        - 84
        - 85
        - 86
        - 87
        - 88
        - 90
        - 91
        - 92
        - 93
        - 94
        - 95
        - 96
        - 97
        - 98
        - 99
        - 100
        - 101
        - 102
        - 103
        - 104
        - 106
        - 107
        - 108
        - 109
        - 110
        - 111
        - 112
        - 113
        - 114
        - 115
        - 116
        - 117
        - 118
        - 119
        - 120
        - 121
        - 122
        - 123
        - 124
        - 125
        - 126
        - 127
        - 128
        - 129
        - 130
        - 131
        - 132
        - 133
        - 134
        - 135
        - 136
        - 139
        - 140
        - 141
        - 142
        - 143
        - 144
        - 145
        - 146
        - 148
      default: 1
    Languages:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
        - 27
        - 28
        - 29
        - 30
        - 31
        - 32
        - 33
        - 34
        - 35
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
        - 45
        - 46
        - 47
        - 48
        - 49
        - 50
        - 51
        - 52
        - 53
        - 54
        - 55
        - 56
        - 57
        - 58
        - 59
        - 60
        - 61
        - 62
        - 63
        - 64
        - 65
        - 66
        - 67
        - 68
        - 69
        - 70
        - 71
        - 72
        - 73
        - 74
        - 75
        - 76
        - 77
        - 78
        - 79
        - 80
        - 81
        - 82
        - 83
        - 84
        - 85
        - 86
        - 87
        - 88
        - 89
        - 90
        - 91
        - 92
        - 93
        - 94
        - 95
        - 96
        - 97
        - 98
        - 99
        - 100
        - 101
        - 102
        - 103
        - 104
        - 105
        - 106
        - 107
        - 108
        - 109
        - 110
        - 111
        - 112
        - 113
        - 114
        - 115
        - 116
        - 117
        - 118
        - 119
        - 120
        - 121
        - 122
        - 123
        - 124
        - 125
        - 126
        - 127
        - 128
        - 129
        - 130
        - 131
        - 132
        - 133
        - 134
        - 135
        - 136
        - 139
        - 140
        - 141
        - 142
        - 143
        - 144
        - 145
        - 146
        - 147
        - 148
        - 149
        - 150
      title: Languages
      default: 1
    ChosenDictionariesSchema:
      type: array
      nullable: true
      items:
        type: integer
      uniqueItems: true
      minItems: 1
      default: null
      description: >-
        An optional list of dictionary IDs selected by the user. Each entry must
        be an integer corresponding to a valid dictionary ID. If provided, at
        least one ID is required.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````