Skip to navigation

How to specify language codes

View as Markdown

Dubbing uses BCP-47 codes for both the source language (spoken in your file) and the target languages you want back. In the REST body those fields are src_lang / target_langs; in the Python SDK they are source_language_code / target_language_codes.

Indian languages & English (source and target)

LanguageCode
English (India)en-IN
Hindihi-IN
Bengalibn-IN
Gujaratigu-IN
Kannadakn-IN
Malayalamml-IN
Marathimr-IN
Odiaor-IN
Punjabipa-IN
Tamilta-IN
Telugute-IN
Assameseas-IN

These 12 codes are valid for both src_lang and target_langs. en-IN (English (India)) is the regional variant of English used in India.

Odia is or-IN for dubbing. Use or-IN in target_langs; a target of od-IN is rejected with 400 InvalidInputError.

More Indian languages (source only)

Videos in these 11 languages can be dubbed into any of the 12 languages above. They are valid for src_lang only, not for target_langs.

LanguageCode
Bodobrx-IN
Dogridoi-IN
Kashmiriks-IN
Konkanikok-IN
Maithilimai-IN
Manipurimni-IN
Nepaline-IN
Sanskritsa-IN
Santalisat-IN
Sindhisd-IN
Urduur-IN

Lower transcription accuracy for Bodo, Dogri, Kashmiri, Maithili, Manipuri, Sanskrit, Santali and Sindhi. Less speech data exists for these languages, so the transcript of the source video has more errors, which carry into the dub. Review the transcript in Studio before exporting.

International languages (source only)

Videos in these 15 languages can be dubbed into any of the 12 languages above. They are valid for src_lang only, not for target_langs.

LanguageCode
Arabicar-SA
Chinese (Mandarin)zh-CN
Dutchnl-NL
Frenchfr-FR
Germande-DE
Indonesianid-ID
Italianit-IT
Japaneseja-JP
Koreanko-KR
Polishpl-PL
Portuguesept-BR
Russianru-RU
Spanishes-ES
Turkishtr-TR
Vietnamesevi-VN
{
"src_lang": "ja-JP",
"target_langs": ["hi-IN", "ta-IN"]
}

Auto-detect the source language

Set src_lang to "auto" when you do not know the language of the video. The language is detected from the speech after the job starts, before transcription, and the job then continues as if you had passed that language. Detection covers the 38 source languages on this page. Hindi and Urdu usually cannot be told apart by ear, so Urdu speech is detected as Hindi; pass ur-IN for an Urdu video.

{
"src_lang": "auto",
"target_langs": ["hi-IN", "ta-IN"]
}

Detection is not always accurate, so pass the language whenever you know it. "auto" is an option, not the default: src_lang is still required, and a wrong detection produces a dub transcribed in the wrong language.

If the language cannot be detected, the job fails with an error_message asking you to select the source language. This happens when:

  • the media has too little speech to identify a language;
  • the language cannot be identified with enough confidence;
  • the media is in a language that is not supported as a source.

Create a new job with src_lang set to the video’s language in these cases.

Leave the video’s own language out of target_langs. With "auto", the source is unknown when the job is created, so a target equal to the detected language is not rejected; it is dubbed and billed like any other target.

Source and target must differ

The source language cannot appear in the target list. Same-language dubbing is not supported, so src_lang: "en-IN" with en-IN among target_langs is rejected with 400 InvalidInputError. If you loop over a fixed set of languages, filter the source out before building the request.