Lyd
Dubb Runway-lyd
Oversett talt lyd til et målspråk med Runway API.
POST
/
runwayml
/
v1
/
voice_dubbing
cURL
curl https://api.cometapi.com/runwayml/v1/voice_dubbing \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "eleven_voice_dubbing",
"audioUri": "https://your-audio-host/source-speech.mp3",
"targetLang": "es"
}'
import os
import requests
payload = { 'model': 'eleven_voice_dubbing',
'audioUri': 'https://your-audio-host/source-speech.mp3',
'targetLang': 'es'}
response = requests.post(
"https://api.cometapi.com/runwayml/v1/voice_dubbing",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json=payload,
)
response.raise_for_status()
print(response.json()["id"])
const payload = {
"model": "eleven_voice_dubbing",
"audioUri": "https://your-audio-host/source-speech.mp3",
"targetLang": "es"
};
const response = await fetch(
"https://api.cometapi.com/runwayml/v1/voice_dubbing",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
},
);
if (!response.ok) throw new Error(await response.text());
const task = await response.json();
console.log(task.id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/voice_dubbing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'eleven_voice_dubbing',
'audioUri' => 'https://your-audio-host/source-speech.mp3',
'targetLang' => 'es'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/voice_dubbing"
payload := strings.NewReader("{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/voice_dubbing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/voice_dubbing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-42d3-a456-426614174000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Bruk
Utelat de boolske kontrollene for å bruke modellstandardene. Å sende
POST /runwayml/v1/voice_dubbing til å oversette talt lyd til et annet
språk. Bruk modell-ID-en eleven_voice_dubbing.
Send CometAPI API-nøkkelen med Bearer-autentisering og en JSON-forespørselstekst.
Oppgi lyd og et målspråk
AngiaudioUri til en tilgjengelig HTTPS-URL for kildelyden din.
Angi targetLang til språkkoden for målspråket, for eksempel es for spansk
eller fr for fransk. Velg den støttede koden fra forespørselsskjemaet.
Forespørselen krever model, audioUri og targetLang.
Erstatt eksempel-URL-en for lyd med kildefilen din.
Konfigurer dubbing
| Felt | Handling |
|---|---|
disableVoiceCloning | Angi true for å bruke en generisk stemme i stedet for å klone kildestemmen. |
dropBackgroundAudio | Angi true for å fjerne bakgrunnslyd fra den dubbede utdataen. |
numSpeakers | Oppgi et positivt heltall for antallet talere i kilden, eller utelat det for automatisk registrering. |
false bruker også
standardene.
Hent resultatet
Lagre den returnerteid, og bruk Hent en Runway-oppgave
for å hente oppgavestatus. Når status er SUCCEEDED, les lyd-URL-ene i
output. Hvis oppgaven mislykkes, undersøk failure og failureCode.Kropp
application/json
Request settings for eleven_voice_dubbing.
Svar
Task created. Save the returned id to retrieve task status.
Sist endret 21. september 2026
⌘I
cURL
curl https://api.cometapi.com/runwayml/v1/voice_dubbing \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "eleven_voice_dubbing",
"audioUri": "https://your-audio-host/source-speech.mp3",
"targetLang": "es"
}'
import os
import requests
payload = { 'model': 'eleven_voice_dubbing',
'audioUri': 'https://your-audio-host/source-speech.mp3',
'targetLang': 'es'}
response = requests.post(
"https://api.cometapi.com/runwayml/v1/voice_dubbing",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json=payload,
)
response.raise_for_status()
print(response.json()["id"])
const payload = {
"model": "eleven_voice_dubbing",
"audioUri": "https://your-audio-host/source-speech.mp3",
"targetLang": "es"
};
const response = await fetch(
"https://api.cometapi.com/runwayml/v1/voice_dubbing",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
},
);
if (!response.ok) throw new Error(await response.text());
const task = await response.json();
console.log(task.id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/runwayml/v1/voice_dubbing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'eleven_voice_dubbing',
'audioUri' => 'https://your-audio-host/source-speech.mp3',
'targetLang' => 'es'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cometapi.com/runwayml/v1/voice_dubbing"
payload := strings.NewReader("{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cometapi.com/runwayml/v1/voice_dubbing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cometapi.com/runwayml/v1/voice_dubbing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"eleven_voice_dubbing\",\n \"audioUri\": \"https://your-audio-host/source-speech.mp3\",\n \"targetLang\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-42d3-a456-426614174000"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}