# 1. send your script as timed segments - one speaker per line
curl -X POST https://api.rask.ai/v2/transcriptions \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"segments": [
{"speaker": "SPEAKER_00", "start": "00:00:00,500", "end": "00:00:04,800",
"src": {"text": "Welcome to the new dashboard.", "lang": "en"},
"dst": {"text": "Bienvenido al nuevo panel.", "lang": "es-mx"}}
]}'
# 2. voice the script over your video
curl -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\", \"transcript_id\": \"$TRANSCRIPT_ID\"}"# When status is merging_done, read the voiceover links
curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" \
| jq '{status, voiceover, translated_audio, translated_video}'ファイルまたは対応するメディアのURLを使用して、音声の元となる動画や音声ファイルをアップロードします。タイムラインによって台本のタイミングが調整されます。
タイムスタンプや話し手情報付きのテキストセグメント、またはSRTファイルから文字起こしを作成し、transcript_idとターゲット言語を指定してプロジェクトを作成します。
音声の一覧表示、各話し手へのプリセットまたはクローンの割り当て、必要に応じた再生成を行い、音声、動画、字幕ファイルをダウンロードします。
# 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)
script = await client.create_transcription(data=schemas.TranscriptionCreate(segments=[
schemas.SegmentCreate(speaker="SPEAKER_00", start="00:00:00,500", end="00:00:04,800",
src=schemas.SegmentTextCreatePatch(text="Welcome to the new dashboard.", lang="en"),
dst=schemas.SegmentTextCreatePatch(text="Bienvenido al nuevo panel.", lang="es-mx")),
]))
job = await wait(client, await client.create_project(data=schemas.ProjectCreate(
video_id=VIDEO_ID, dst_lang="es-mx", transcript_id=script.id)))
# pick a female AI voice preset from the library for SPEAKER_00
voices = await client.get_project_voices(project_id=job.id)
preset = next(v for v in voices if v.gender == "female")
await client.patch_project(project_id=job.id, data=schemas.ProjectPatch(voice={**job.voice, "SPEAKER_00": preset.id}))
job = await wait(client, await client.generate_project(project_id=job.id))
print(job.voiceover, job.translated_video)
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
script = requests.post(f"{API}/v2/transcriptions", headers=h, json={"segments": [
{"speaker": "SPEAKER_00", "start": "00:00:00,500", "end": "00:00:04,800",
"src": {"text": "Welcome to the new dashboard.", "lang": "en"},
"dst": {"text": "Bienvenido al nuevo panel.", "lang": "es-mx"}},
]}).json()
pid = requests.post(f"{API}/v2/projects", headers=h, json={
"video_id": VIDEO_ID, "dst_lang": "es-mx", "transcript_id": script["id"]}).json()["id"]
project = wait(pid)
voices = requests.get(f"{API}/v2/projects/{pid}/voices", headers=h).json()
preset = next(v for v in voices if v["gender"] == "female")
requests.patch(f"{API}/v2/projects/{pid}", headers=h,
json={"voice": {**project["voice"], "SPEAKER_00": preset["id"]}})
requests.post(f"{API}/v2/projects/{pid}/generate", headers=h)
print(wait(pid)["voiceover"])// 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; };
const script = await call('POST', '/v2/transcriptions', { segments: [
{ speaker: 'SPEAKER_00', start: '00:00:00,500', end: '00:00:04,800',
src: { text: 'Welcome to the new dashboard.', lang: 'en' },
dst: { text: 'Bienvenido al nuevo panel.', lang: 'es-mx' } },
] });
const { id } = await call('POST', '/v2/projects', { video_id: VIDEO_ID, dst_lang: 'es-mx', transcript_id: script.id });
const project = await wait(id);
const voices = await call('GET', `/v2/projects/${id}/voices`);
const preset = voices.find((v) => v.gender === 'female');
await call('PATCH', `/v2/projects/${id}`, { voice: { ...project.voice, SPEAKER_00: preset.id } });
await call('POST', `/v2/projects/${id}/generate`);
console.log((await wait(id)).voiceover);# 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. your script as an SRT file in the target language
TRANSCRIPT_ID=$(curl -s -X POST "https://api.rask.ai/v2/transcriptions/srt?dst_lang=es-mx" \
-H "Authorization: Bearer $TOKEN" -F "dst=@script_es-mx.srt" | jq -r .id)
# 3. voice it over the video
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\", \"transcript_id\": \"$TRANSCRIPT_ID\"}" | jq -r .id)
# 4. when status is merging_done, read the voiceover links
curl -s https://api.rask.ai/v2/projects/$ID -H "Authorization: Bearer $TOKEN" \
| jq '{status, voiceover, translated_video}'<?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']];
$script = $json($http->post('/v2/transcriptions', ['headers' => $h, 'json' => ['segments' => [[
'speaker' => 'SPEAKER_00', 'start' => '00:00:00,500', 'end' => '00:00:04,800',
'src' => ['text' => 'Welcome to the new dashboard.', 'lang' => 'en'],
'dst' => ['text' => 'Bienvenido al nuevo panel.', 'lang' => 'es-mx'],
]]]]));
$p = $json($http->post('/v2/projects', ['headers' => $h, 'json' => [
'video_id' => $videoId, 'dst_lang' => 'es-mx', 'transcript_id' => $script['id']]]));
while ($p['status'] !== 'merging_done') {
sleep(10);
$p = $json($http->get("/v2/projects/{$p['id']}", ['headers' => $h]));
}
echo $p['voiceover'];{"label": "Renata", "gender": "female", "sample_src": "https://..."} AI voice preset
{"label": "Gerardo", "gender": "male", "sample_src": "https://..."} AI voice preset
{"label": "Maria Lopez", "gender": "auto", "sample_src": "https://..."} custom voice clone
{"label": "Voice Clone", "gender": "auto", "sample_src": null} instant voice clone

es-mx および es-es 同様に。プロジェクトの記録 glossary_versionのため、後から編集しても完成した作業が勝手に変更されることはありません。はい、動画のナレーション用にご利用いただけます。タイムコード付きのテキストセグメントまたはSRTファイルを動画と一緒に送信すると、APIが映像のタイミングに合わせた自然な音声(AI音声またはボイスクローン)を生成し、同じプロジェクト内で字幕や音声トラックも作成します。
Raskはプロジェクト全体の音声を生成してファイルとして納品するため、公開用の動画やトレーニング、マーケティングコンテンツに適しています。音声の即時出力が必要な音声エージェントやコンタクトセンターなどの用途には、ストリーミング対応の音声合成APIのほうが適しています。
プロジェクトの生成が完了した時点で音声が納品されます。対象プランでは、WAV形式のナレーション、ミックス済み音声、動画が提供されます。APIの生成中に音声のチャンクやバイト単位でストリーミング配信されることはありません。
話者、HH:MM:SS,mmm形式の開始・終了時間、テキストが含まれるセグメントを使用して、POST /v2/transcriptionsでトランスクリプトを作成します。また、SRTファイルをPOST /v2/transcriptions/srtにアップロードすることも可能です。その後、プロジェクト作成時にtranscript_idを指定してください。
各言語や地域の音声ライブラリには、性別が設定されたAI音声のプリセットが用意されています。GET /v2/projects/{id}/voicesでプロジェクトのオプションを取得し、音声IDを使用して話者ごとに割り当てます。ボイスクローンに対応している言語では、ボイスクローンも使用できます。
はい。話者の同意を得た上で、Raskアプリでカスタムボイスクローンを一度作成すれば、APIを通じて対応言語内のどの話者にもその音声IDを割り当てることができます。一貫したブランドボイスとして効果的です。
135以上の言語や地域から選択できます。原稿を1つの言語で入力してRaskに翻訳させることも、すでに翻訳された原稿をそのまま送信することも可能です。すべての対応言語でAI音声を利用できます。
APIではセグメントごとに通常のテキストを受け付けます。発音を調整したい場合は、スクリプト内のスペルを調整してください。用語集は単語の翻訳方法を制御するものであり、発音を制御するものではありません。
音声の表現は、選択した音声と句読点を含むテキストに従います。実際の演技のような豊かな感情表現を持たせるには、元の話者のボイスクローンを使用すると、その人らしさをより多く残すことができます。
動画または音声ファイルを使用できます。元のファイルをアップロードし、タイミングに合わせたスクリプトを提供することで、タイムラインに沿ったボイスオーバーを生成できます。ファイルのアップロードが必須となります。
いいえ。利用料金は動画の分数ごとに請求され、端数は次の1分に切り上げられます。Raskアプリと共通の分数プールから消化されます。対象となる標準プランでは、追加分数を1分あたり3ドルでご利用いただけます。エンタープライズプランの料金は、ご契約内容に合わせて個別に設定されます。再吹き替えは変更されたセグメント単位で請求され、1回あたりの最低請求時間は1分となります。
クレジットカードの登録不要でRaskアプリの無料トライアルから始められ、ご自身の動画でAI音声を確認できます。APIアクセスは、Creator Pro、Business、Enterpriseの各プランでご利用可能で、利用できる機能はプランによって異なります。
APIへのアクセスは、Creator Pro、Business、Enterpriseの各プランでご利用いただけ、機能はプランによって異なります。アプリ内でクライアントIDとシークレットを生成すれば、すぐに使い始めることができます。Enterpriseの契約条件、大量利用時の割引、カスタム言語への対応については、弊社チームまでお問い合わせください。