Skip to main content
Dub transcribes a recording, translates its speech and renders a new spoken track. Hindi (hi) is the currently enabled output language. The English-to-Hindi audio workflow is available through the API. Use Speak when you already have text to synthesize, or Cast when you want to direct a voiceover from a script. Dub starts with an existing recording and runs asynchronously.

Before you start

In Console → API Keys, create or edit a product key and select Dub under Dub, speech-to-speech dubbing. The default Voice agent preset does not include Dub. Use a key with dub:render and check its scopes with GET /v1/me. A key without this scope returns 403; a live key may also require funded credit. Keep the key on your server. This example uses an English WAV. Supply source_lang=en and target_lang=hi. You do not need to transcribe or translate the recording yourself.

1. Submit the recording

The response is 202 Accepted, for example:
Keep the returned job_id. status_url is a relative path on https://api.pyai.com; it requires your product key. Send exactly one source: file or source_url. A file upload must be non-empty and no larger than 200 MiB. For a URL, send a publicly reachable media address in the source_url form field instead of file.

2. Poll until processing finishes

Poll every few seconds with backoff when the service is busy. Processing time depends on the recording and current capacity. This is not a streaming API. A failed job returns HTTP 200 with status: "error"; HTTP success alone does not establish that dubbing succeeded. A completed audio job includes fields such as:
source_seconds, dubbed_seconds and progress details may also be present. Treat stage labels and diagnostic fields as extensible; branch on status.

3. Download the audio

The result is a WAV file. Save it in your application and review it before publishing. Downloading before done returns 409 job_not_done. An expired output returns 410 and needs a new render. Do not rely on job output storage as your archive. Audio delivery is metered using the source-audio duration, not the length of the translated output. See pricing and metering for billing conventions; this guide does not promise a fixed completion time.

Languages

Accepted input codes do not mean Dub can produce those languages. Speak’s language catalog does not describe Dub’s output-language availability.

Optional fields

All fields use multipart form data. JSON fields are JSON-encoded strings. The audio quickstart above does not require any of these options.

Video outputs

The submission endpoint also accepts video containers. A completed video job can include video_url or outputs.video; fetch that returned path with your product key. Audio-source jobs have no video output and return 404 no_video_output from /video. The source picture is retained with a dubbed audio track; this is not lip synchronization. The quickstart and listenable sample on the Dub product page demonstrate audio dubbing.

Handle errors

See the API reference for request and response schemas, or errors and limits for shared API failures.