# 1. create the dub - each speaker gets an Instant Voice Clone by default
curl -X POST https://api.rask.ai/v2/projects \
-H "Authorization: Bearer $TOKEN" \
-d '{"video_id": "b8f7835d-e8c9-4ff4-8e34-5c336d818319", "dst_lang": "es-mx"}'
# 2. list the voices available in this project
curl https://api.rask.ai/v2/projects/$ID/voices \
-H "Authorization: Bearer $TOKEN"
# "label": "Voice Clone", "gender": "auto" instant clone
# "label": "Maria Lopez", "sample_src": "https://..." your custom clone
# 3. assign your custom clone - include every speaker in the map
curl -X PATCH https://api.rask.ai/v2/projects/$ID \
-H "Authorization: Bearer $TOKEN" \
-d '{"voice": {"SPEAKER_00": "<custom_voice_id>", "SPEAKER_01": "<voice_id>"}}'# 4. re-dub with the new voices, then poll until merging_done
curl -X POST https://api.rask.ai/v2/projects/$ID/generate \
-H "Authorization: Bearer $TOKEN"
while :; do
curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" | jq .status
sleep 10
doneマルチパートフォームデータとしてファイルを送信するか、YouTube、Googleドライブ、S3、Vimeo、または任意の直接URLからリンクを投稿してください。この動画内の音声が、各インスタントボイスクローンのサンプルとなります。
メディアIDを video_id として渡し、ターゲット言語を指定します。検出された話者ごとに、対応言語でのインスタントボイスクローンが作成され、すぐに吹き替えが開始されます。
プロジェクトの音声を一覧表示し、カスタムクローンやプリセットを各話者に割り当てた後、/generate を呼び出し、吹き替えが完了したらファイルをダウンロードします。
# pip install git+ssh://[email protected]/braskai/rask-sdk.git@main
import asyncio
from rask_sdk import clients, enums, schemas
async def wait(client, job):
while job.status is not enums.ProjectStatus.MERGING_DONE:
await asyncio.sleep(10)
job = await client.get_project(project_id=job.id)
return job
async def main():
client = clients.RaskSDKClient(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
video = await client.create_media_link(data=schemas.MediaCreateLink(link="https://youtu.be/..."))
while video.status is not enums.MediaStatus.READY:
await asyncio.sleep(5)
video = await client.get_media(media_id=video.id)
# first dub: every speaker gets an Instant Voice Clone
job = await wait(client, await client.create_project(
data=schemas.ProjectCreate(video_id=video.id, dst_lang="es-mx")))
# assign a custom clone to SPEAKER_00, keep the other speakers as they are
voices = await client.get_project_voices(project_id=job.id)
custom = next(v for v in voices if v.label == "Maria Lopez")
voice_map = {**job.voice, "SPEAKER_00": custom.id}
await client.patch_project(project_id=job.id, data=schemas.ProjectPatch(voice=voice_map))
job = await wait(client, await client.generate_project(project_id=job.id))
print(job.translated_video, job.voiceover)
asyncio.run(main())import time, requests
AUTH = "https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token"
API = "https://api.rask.ai"
token = requests.post(AUTH, auth=(CLIENT_ID, CLIENT_SECRET),
data={"grant_type": "client_credentials"}).json()["access_token"]
h = {"Authorization": f"Bearer {token}"}
def wait(pid):
while (p := requests.get(f"{API}/v2/projects/{pid}", headers=h).json())["status"] != "merging_done":
time.sleep(10)
return p
video = requests.post(f"{API}/api/library/v1/media/link", headers=h, json={"link": "https://youtu.be/..."}).json()
while video["status"] != "ready":
time.sleep(5)
video = requests.get(f"{API}/api/library/v1/media/{video['id']}", headers=h).json()
pid = requests.post(f"{API}/v2/projects", headers=h,
json={"video_id": video["id"], "dst_lang": "es-mx"}).json()["id"]
project = wait(pid)
voices = requests.get(f"{API}/v2/projects/{pid}/voices", headers=h).json()
custom = next(v for v in voices if v["label"] == "Maria Lopez")
voice_map = {**project["voice"], "SPEAKER_00": custom["id"]} # every speaker stays in the map
requests.patch(f"{API}/v2/projects/{pid}", headers=h, json={"voice": voice_map})
requests.post(f"{API}/v2/projects/{pid}/generate", headers=h)
print(wait(pid)["translated_video"])// no dependencies, Node 18+ global fetch
const API = 'https://api.rask.ai';
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
const auth = await fetch('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token', {
method: 'POST',
headers: { Authorization: 'Basic ' + btoa(`${CLIENT_ID}:${CLIENT_SECRET}`) },
body: new URLSearchParams({ grant_type: 'client_credentials' }),
}).then((r) => r.json());
const h = { Authorization: `Bearer ${auth.access_token}`, 'Content-Type': 'application/json' };
const call = (method, path, body) => fetch(API + path, { method, headers: h, body: body && JSON.stringify(body) }).then((r) => r.json());
const wait = async (id) => { let p; while ((p = await call('GET', `/v2/projects/${id}`)).status !== 'merging_done') await sleep(10000); return p; };
let video = await call('POST', '/api/library/v1/media/link', { link: 'https://youtu.be/...' });
while (video.status !== 'ready') { await sleep(5000); video = await call('GET', `/api/library/v1/media/${video.id}`); }
const { id } = await call('POST', '/v2/projects', { video_id: video.id, dst_lang: 'es-mx' });
const project = await wait(id);
const voices = await call('GET', `/v2/projects/${id}/voices`);
const custom = voices.find((v) => v.label === 'Maria Lopez');
await call('PATCH', `/v2/projects/${id}`, { voice: { ...project.voice, SPEAKER_00: custom.id } });
await call('POST', `/v2/projects/${id}/generate`);
console.log((await wait(id)).translated_video);# 1. token (valid 1 hour - cache and reuse it)
TOKEN=$(curl -s -X POST https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token \
-u "$CLIENT_ID:$CLIENT_SECRET" -d "grant_type=client_credentials" | jq -r .access_token)
# 2. create the dub - Instant Voice Clones are assigned by default
ID=$(curl -s -X POST https://api.rask.ai/v2/projects -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" -d "{\"video_id\": \"$VIDEO_ID\", \"dst_lang\": \"es-mx\"}" | jq -r .id)
# 3. after merging_done: read the current voice map and the voice options
curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" | jq .voice
curl -s https://api.rask.ai/v2/projects/$ID/voices -H "Authorization: Bearer $TOKEN" | jq '.[] | {id, label, gender}'
# 4. assign voices for every speaker, then re-dub
curl -s -X PATCH https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" -d '{"voice": {"SPEAKER_00": "<custom_voice_id>", "SPEAKER_01": "<voice_id>"}}'
curl -s -X POST https://api.rask.ai/v2/projects/$ID/generate -H "Authorization: Bearer $TOKEN"<?php
use GuzzleHttp\Client;
$http = new Client(['base_uri' => 'https://api.rask.ai']);
$json = fn($r) => json_decode($r->getBody(), true);
$auth = $json((new Client)->post('https://rask-prod.auth.us-east-2.amazoncognito.com/oauth2/token',
['auth' => [$clientId, $clientSecret], 'form_params' => ['grant_type' => 'client_credentials']]));
$h = ['Authorization' => 'Bearer ' . $auth['access_token']];
$wait = function ($id) use ($http, $h, $json) {
do { sleep(10); $p = $json($http->get("/v2/projects/$id", ['headers' => $h])); }
while ($p['status'] !== 'merging_done');
return $p;
};
$id = $json($http->post('/v2/projects', ['headers' => $h,
'json' => ['video_id' => $videoId, 'dst_lang' => 'es-mx']]))['id'];
$project = $wait($id);
$voices = $json($http->get("/v2/projects/$id/voices", ['headers' => $h]));
$custom = current(array_filter($voices, fn($v) => $v['label'] === 'Maria Lopez'));
$map = array_merge($project['voice'], ['SPEAKER_00' => $custom['id']]);
$http->patch("/v2/projects/$id", ['headers' => $h, 'json' => ['voice' => $map]]);
$http->post("/v2/projects/$id/generate", ['headers' => $h]);
echo $wait($id)['translated_video']; 0s created
11s transcription_started
87s translation_started
99s voiceover_started
154s merging_started
165s merging_done

es-mx および es-es 同様に機能します。プロジェクトには glossary_versionが記録されるため、後から編集を行っても、完了した作業が勝手に変更されることはありません。はい。Raskの音声クローンAPIは、動画のダビングの一環として各話者の声をクローンします。ターゲット言語を指定してプロジェクトを作成すると、対応言語においてすべての話者にインスタント音声クローンが適用されます。また、Raskアプリで作成したカスタム音声クローンを任意の話者に割り当てることも可能です。
インスタント音声クローンは、対応するターゲット言語の元動画にある話者の音声を使用します。再利用可能なカスタム音声クローンを作成するには、話者の同意を得てRaskアプリで作成し、API経由で割り当てます。結果は、元の音声、選択した言語、および音声によって異なります。
インスタント音声クローンは、ダビングする動画の音声から自動的に作成されるため、短い音声サンプルを録音する必要はありません。一方、カスタム音声クローンは、一度アップロードした音声サンプルからトレーニングされ、音声ライブラリに保存されるため、voice_idを使用してどのプロジェクトでも再利用できます。音声リストでは、インスタント音声クローンには「Voice Clone」というラベルと「auto」という性別が表示されます。
カスタム音声クローンの作成は、Raskのウェブプラットフォームで行うことができます。クローンが保存されたら、プロジェクト音声取得エンドポイントでそのvoice_idを取得し、APIを通じて話者に割り当てます。
1分から10分分の音声または動画(MP4、MOV、WEBM、MKV、MP3、M4A、WAV形式、1ファイル最大10MBで合計10ファイルまで)をアップロードするか、YouTubeやGoogleドライブのリンクを貼り付けてください。最高の品質を得るために、雑音のない静かな部屋で良質なマイクを使用し、一貫した話し方をする1人の話者の音声をご用意ください。
音声クローンは32の基本言語とその対応する地域バリエーションをサポートしています。地域バリエーションには基本のクローンモデルが使用されます(例:イギリス英語のテキストにはアメリカ英語の音声モデルが使用されます)。その他の翻訳先言語については、AI音声プリセットをお選びください。詳細なリストはAPI言語カタログをご覧ください。
このAPIは、音声のみのポッドキャストやインタビューを含め、動画と音声の両方の録音データに対応しています。ご自身の言葉を使用するには、翻訳されたテキストをセグメントごとに編集するか、プロジェクトを作成する前にご自身の.srtファイルからトランスクリプトを作成してください。クローンされた音声がそのテキストを読み上げます。入力は常に録音データとなるため、テキストのみの音声ナレーションにはテキスト読み上げAPIの方が適しています。
GET /v2/projects/{id}/voices で音声オプションを取得し、変更する音声と変更しない音声を含むボイスマップを指定して PATCH /v2/projects/{id} を送信します。次に /generate を呼び出して再吹き替えを行います。再吹き替えは、変更されたセグメントの合計時間に基づいて課金され、実行ごとに1分間の最低料金が適用されます。
クリエイタープロプランでは最大3つのカスタム音声、ビジネスプランではチームで共有できる最大10の音声、エンタープライズプランではカスタム音声ライブラリをご利用いただけます。
はい。カスタム音声クローンは話者の同意を得て作成されるものであり、話者の同意が得られている動画のみを吹き替える必要があります。Raskでは同意に基づく音声クローンとAIの安全管理を採用しており、音声が汎用モデルのトレーニングに使用されることは一切ありません。
クローンは音色やピッチを含む話者の声の特徴を再現するため、別の言語でも本人らしく聞こえます。感情のトーン、緩急、リズムは元の音声と翻訳されたスクリプトに従うため、クリアで表現力豊かな元の音声を使用すると、より良い結果が得られます。
元動画の権利と話者の同意を得ている場合は、クローン音声を使用した吹き替え動画を商用コンテンツとして公開できます。ご自身のプランに適用される詳細は、Raskの利用規約をご確認ください。
音声クローンは吹き替え機能の一部であり、追加料金はかかりません。APIの利用料金は、動画の分数ごとに(1分未満は切り上げ)、Raskアプリの共通の分数プールから引き落とされます。プランの分量を超過した場合は、1分あたり3ドルかかります。音声変更後の再吹き替えは、変更されたセグメントの分数のみが課金対象となります。クレジットカード不要の無料トライアルからぜひお試しください。