# 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 จะไม่สตรีมส่วนของเสียงหรือไบต์เสียงในขณะที่กำลังสร้าง
สร้างบทถอดเสียงด้วย POST /v2/transcriptions จากส่วนที่มีผู้พูด เวลาเริ่มต้นและสิ้นสุดในรูปแบบ ชม:นาที:วินาที,มิลลิวินาที และข้อความ คุณยังสามารถอัปโหลดไฟล์ SRT ไปที่ POST /v2/transcriptions/srt ได้ จากนั้นระบุ transcript_id เมื่อคุณสร้างโปรเจกต์
ทุกภาษาเป้าหมายจะมีเสียง AI สำเร็จรูปพร้อมระบุเพศในคลังเสียง ดูตัวเลือกสำหรับโปรเจกต์ได้ที่ GET /v2/projects/{id}/voices และกำหนดเสียงหนึ่งเสียงต่อผู้พูดหนึ่งคนด้วยรหัสเสียง ในภาษาที่รองรับการโคลนเสียง คุณยังสามารถใช้เสียงโคลนได้อีกด้วย
ได้ สร้างโคลนเสียงเฉพาะตัวในแอป Rask หนึ่งครั้งโดยได้รับความยินยอมจากผู้พูด จากนั้นกำหนดรหัสเสียงให้กับผู้พูดคนใดก็ได้ผ่าน API ในภาษาที่รองรับการโคลนเสียง วิธีนี้ใช้ได้ดีกับการสร้างเสียงแบรนด์ที่สม่ำเสมอ
เลือกจากภาษาและตัวเลือกภูมิภาคมากกว่า 135 แบบ เขียนสคริปต์ในภาษาเดียวแล้วให้ Rask แปลให้ หรือส่งสคริปต์ที่เป็นภาษาเป้าหมายอยู่แล้ว เสียง AI มีให้บริการสำหรับทุกภาษาเป้าหมาย
API จะรับข้อความธรรมดาในแต่ละส่วน หากต้องการแนะนำการออกเสียง ให้ปรับการสะกดในข้อความสคริปต์ อภิธานศัพท์จะควบคุมวิธีการแปลคำ ไม่ใช่วิธีการออกเสียง
การถ่ายทอดเสียงจะเป็นไปตามเสียงที่เลือกและข้อความของคุณ รวมถึงเครื่องหมายวรรคตอน สำหรับช่วงอารมณ์ที่ตรงกับการแสดงจริง การใช้เสียงโคลนของผู้พูดต้นฉบับจะช่วยรักษาเอกลักษณ์เสียงของพวกเขาไว้ได้มากกว่า
คุณสามารถใช้วิดีโอหรือไฟล์เสียงได้ เพียงอัปโหลดไฟล์ต้นฉบับและใส่สคริปต์ที่มีการกำหนดเวลาเพื่อสร้างเสียงพากย์ตามไทม์ไลน์ จำเป็นต้องอัปโหลดไฟล์สื่อเข้ามาด้วย
ไม่ใช่ เราคิดค่าบริการตามความยาวของวิดีโอเป็นนาที โดยปัดเศษขึ้นเป็นนาทีเต็มถัดไป ซึ่งจะหักจากโควตานาทีเดียวกับแอป Rask สำหรับนาทีส่วนเกินจะคิดราคา $3 ต่อนาที ในแพ็กเกจมาตรฐานที่ร่วมรายการ ส่วนลูกค้าระดับองค์กรจะมีราคาตามข้อตกลงของคุณ สำหรับการพากย์เสียงทับใหม่จะคิดค่าบริการเฉพาะส่วนที่มีการเปลี่ยนแปลง โดยมีขั้นต่ำ 1 นาทีต่อการใช้งาน
เริ่มต้นใช้งานด้วยการทดลองใช้ฟรีในแอป Rask ไม่ต้องใช้บัตรเครดิต เพื่อลองฟังเสียงบนวิดีโอของคุณเอง สำหรับการเข้าถึง API จะมีให้บริการในแพ็กเกจ Creator Pro, Business และ Enterprise โดยฟีเจอร์จะขึ้นอยู่กับแพ็กเกจที่คุณเลือก
การเข้าถึง API มีให้บริการในแพ็กเกจ Creator Pro, Business และ Enterprise โดยความสามารถจะขึ้นอยู่กับแพ็กเกจของคุณ คุณสามารถสร้างรหัสลูกค้าและรหัสลับได้ในแอปและเริ่มใช้งานได้ทันที สำหรับเงื่อนไขระดับองค์กร ราคาส่ง และการรองรับภาษาเฉพาะ โปรดติดต่อทีมงานของเรา