Skip to main content

Create Dubbing Endpoint

Overview

The endpoint enables automatic voice translation of videos from one language to another. It accepts a video file link and various parameters to control the dubbing process.

Request

--request POST 'https://modelslab.com/api/v6/voice/create_dubbing' \

Make a POST request to https://modelslab.com/api/v6/voice/create_dubbing endpoint and pass the required parameters as a request body.

Body Attributes

ParameterDescriptionValues
keyThe API key used for authenticating your request.String
init_videoURL to the video file to be dubbedText
source_langSource language code of the video, default is "en".en, ar, es,pt-BR,de,cs,zh ,nl,fr,hi ,hu, it,ja,ko,pl,ru, tr
output_langTarget language code for dubbingen, ar, es,pt-BR,de,cs,zh ,nl,fr,hi ,hu, it,ja,ko,pl,ru, tr
file_prefixPrefix for the output file name Defaults to 10.string/number
base64Indicates whether the input audio file is provided in base64 format. Defaults to false.TRUE or FALSE
seedRandom seed for reproducibility (if 0, a random seed is generated)Int (random number )
webhookA URL where the API will send a POST request once the audio generation is complete.URL
track_idAn ID returned in the API response, used to identify webhook requestsIntegral value
Open in Playground 🚀

Example

Body

Body
{   
"key": "",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": false
"webhook": null,
"track_id": null
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"init_video": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": 1.2,
"file_prefix": "spanish_dub",
"base64": false
"webhook": null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/voice/create_dubbing", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"generationTime": 1.904285192489624,
"id": 334166,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4",
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4",
"https://cdn2.stablediffusionapi.com/audio_generations/dubbed_video_d0c1da80-40a0-4981-84bb-f52a44a560e5_10.mp4"
],
"meta": {
"uuid": "d0c1da80-40a0-4981-84bb-f52a44a560e5",
"video_link": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/ykl9xK5huFozCS1lDIhlqSbzhTgsuw-metaRnVsbCBzcGVlY2hfIFB1dGluIGRlZmlhbnQgaW4gYWRkcmVzcyB0byBuYXRpb24gYWZ0ZXIgYXR0ZW1wdGVkIGFybWVkIHJlYmVsbGlvbi5tcDQ=-.mp4",
"source_lang": "ru",
"output_lang": "en",
"speed": "1.2",
"file_prefix": 10,
"is_base64": false
}
}