# 1. import your own script as the project transcript
curl -X POST https://api.rask.ai/v3/projects/$ID/transcript/import \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target": {
"format": "srt",
"content": "1\n00:00:00,000 --> 00:00:04,200\nWelcome to the Q3 release.\n"
}
}'
# 2. the price first - free, and it changes nothing
curl -X POST https://api.rask.ai/v3/projects/$ID/dub/estimate \
-H "Authorization: Bearer $RASK_API_KEY"
# 3. voice it - the price you accepted is the ceiling
curl -X POST https://api.rask.ai/v3/projects/$ID/dub \
-H "Authorization: Bearer $RASK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expected_cost_minutes": 12}'# Wait on the job instead of polling: one request, up to 20 seconds.
curl -s "https://api.rask.ai/v3/jobs/$JOB_ID?wait_seconds=20" \
-H "Authorization: Bearer $RASK_API_KEY" | jq .status



อัปโหลดวิดีโอหรือไฟล์เสียงที่คุณต้องการใส่เสียงพากย์ โดยใช้ไฟล์หรือ URL สื่อที่รองรับ ไทม์ไลน์จะช่วยกำหนดจังหวะเวลาสำหรับสคริปต์ของคุณ
สร้างบทพูดจากส่วนข้อความที่มีเวลาและระบุผู้พูด หรือจากไฟล์ SRT จากนั้นสร้างโปรเจกต์ด้วยภาษาที่ต้องการแล้วนำเข้าบทพูดนั้น
ดูรายการเสียง กำหนดค่าเสียงที่ตั้งไว้ล่วงหน้าหรือเสียงโคลนให้กับผู้พูดแต่ละคน สร้างเสียงใหม่ได้หากต้องการ จากนั้นดาวน์โหลดเสียงพากย์ วิดีโอ และไฟล์ซับไตเติล
# pip install rask-sdk
from rask_sdk import Rask
rask = Rask() # reads RASK_API_KEY
uploaded = rask.jobs.wait(rask.uploads.upload_file("explainer.mp4").id)
media_id = uploaded.result.media_id
# the price first - free, and it changes nothing
estimate = rask.projects.estimate_project(
media_id=media_id, target_language="en-us"
)
# the price you accepted is the ceiling
created = rask.projects.create_project(
media_id=media_id,
target_language="en-us",
expected_cost_minutes=estimate.total_minutes,
)
processed = rask.jobs.wait(created.id)
for o in rask.exports.list_project_outputs(processed.result.project_id).data:
print(o.kind, o.url)import os, requests
API = "https://api.rask.ai/v3"
h = {"Authorization": f"Bearer {os.environ['RASK_API_KEY']}"}
# your own script becomes the project transcript
requests.post(f"{API}/projects/{project_id}/transcript/import", headers=h, json={
"target": {
"format": "srt",
"content": open("script.srt").read(),
},
})
# the price first - free, and it changes nothing
estimate = requests.post(f"{API}/projects/{project_id}/dub/estimate", headers=h).json()
# the price you accepted is the ceiling
job = requests.post(f"{API}/projects/{project_id}/dub", headers=h,
json={"expected_cost_minutes": estimate["total_minutes"]}).json()
requests.get(f"{API}/jobs/{job['id']}?wait_seconds=20", headers=h).json()// no dependencies, Node 18+ global fetch
import { readFileSync } from 'node:fs';
const API = 'https://api.rask.ai/v3';
const h = {
Authorization: `Bearer ${process.env.RASK_API_KEY}`,
'Content-Type': 'application/json',
};
// your own script becomes the project transcript
await fetch(`${API}/projects/${projectId}/transcript/import`, {
method: 'POST', headers: h,
body: JSON.stringify({
target: { format: 'srt', content: readFileSync('script.srt', 'utf8') },
}),
});
// the price first - free, and it changes nothing
const estimate = await fetch(`${API}/projects/${projectId}/dub/estimate`, {
method: 'POST', headers: h,
}).then(r => r.json());
// the price you accepted is the ceiling
const job = await fetch(`${API}/projects/${projectId}/dub`, {
method: 'POST', headers: h,
body: JSON.stringify({ expected_cost_minutes: estimate.total_minutes }),
}).then(r => r.json());
await fetch(`${API}/jobs/${job.id}?wait_seconds=20`, { headers: h }).then(r => r.json());API=https://api.rask.ai/v3
AUTH="Authorization: Bearer $RASK_API_KEY"
JSON="Content-Type: application/json"
# 1. import your SRT as the project transcript
jq -n --rawfile srt script.srt '{target: {format: "srt", content: $srt}}' \
| curl -s -X POST $API/projects/$ID/transcript/import -H "$AUTH" -H "$JSON" -d @-
# 2. the price first - free, and it changes nothing
CAP=$(curl -s -X POST $API/projects/$ID/dub/estimate -H "$AUTH" | jq -r .total_minutes)
# 3. voice it - the price you accepted is the ceiling
JOB=$(curl -s -X POST $API/projects/$ID/dub -H "$AUTH" -H "$JSON" \
-d "{\"expected_cost_minutes\":$CAP}" | jq -r .id)
# 4. wait on the job, then collect the voiceover
curl -s "$API/jobs/$JOB?wait_seconds=20" -H "$AUTH" | jq .status
curl -s $API/projects/$ID/outputs -H "$AUTH" \
| jq -r '.data[] | "\(.kind)\t\(.url)"'<?php
use GuzzleHttp\Client;
$http = new Client([
'base_uri' => 'https://api.rask.ai/v3/',
'headers' => ['Authorization' => 'Bearer ' . getenv('RASK_API_KEY')],
]);
// your own script becomes the project transcript
$http->post("projects/{$projectId}/transcript/import", ['json' => [
'target' => ['format' => 'srt', 'content' => file_get_contents('script.srt')],
]]);
// the price first - free, and it changes nothing
$estimate = json_decode(
$http->post("projects/{$projectId}/dub/estimate")->getBody(), true);
// the price you accepted is the ceiling
$job = json_decode($http->post("projects/{$projectId}/dub", ['json' => [
'expected_cost_minutes' => $estimate['total_minutes'],
]])->getBody(), true);
$http->get("jobs/{$job['id']}?wait_seconds=20"); 0s queued
3s running preparing the transcript
40s running voicing
110s running merging
135s succeeded

es-mx และ es-es เหมือนกัน บันทึกของโปรเจกต์ glossary.versionดังนั้นการแก้ไขในภายหลังจึงไม่ส่งผลกระทบต่อAงานที่เสร็จสมบูรณ์แล้วมี สำหรับการพากย์เสียงวิดีโอ ส่งสคริปต์ของคุณเป็นส่วนข้อความที่มีเวลาหรือไฟล์ SRT พร้อมกับวิดีโอ จากนั้น API จะสร้างเสียงพูดที่เป็นธรรมชาติให้ตรงกับภาพ โดยใช้เสียง AI หรือเสียงโคลน พร้อมคำบรรยายและแทร็กเสียงในโปรเจกต์เดียวกัน
Rask สร้างเสียงพูดสำหรับโปรเจกต์ที่สมบูรณ์และส่งมอบไฟล์ ซึ่งเหมาะสำหรับวิดีโอที่เผยแพร่แล้ว เนื้อหาฝึกอบรม และสื่อการตลาด สำหรับระบบเสียงพูดอัตโนมัติ ศูนย์บริการข้อมูล หรือแอปพลิเคชันอื่น ๆ ที่ต้องการเสียงภายในไม่กี่วินาที Text to speech API แบบสตรีมมิ่งจะตอบโจทย์มากกว่า
ระบบจะส่งเสียงให้เมื่อการสร้างโปรเจกต์เสร็จสิ้น โดยเสียงพากย์จะเป็นไฟล์ WAV ในแพ็กเกจที่รองรับ รวมถึงเสียงที่ผสมแล้วและวิดีโอ API จะไม่สตรีมส่วนของเสียงหรือไบต์เสียงในระหว่างที่กำลังสร้าง
นำเข้าสคริปต์ของคุณเองเป็นบทสำหรับโปรเจกต์ด้วย POST /v3/projects/{project_id}/transcript/import เพื่อใช้เป็นข้อความต้นทางหรือปลายทาง ระบบจะเก็บบันทึกทุกเวอร์ชันไว้ คุณจึงสามารถดูรายการ เปรียบเทียบ และกู้คืนได้ จากนั้นพากย์เสียงโปรเจกต์ใหม่เพื่อให้เสียงพากย์ตรงกับสคริปต์ของคุณ
แต่ละภาษาเป้าหมายจะมีเสียงพากย์ AI แบบตั้งค่าล่วงหน้าพร้อมระบุเพศไว้ในคลังเสียง เรียกดูตัวเลือกสำหรับโปรเจกต์ได้ด้วย GET /v3/projects/{project_id}/voices และกำหนดเสียงให้ผู้พูดแต่ละคนด้วย PUT /v3/projects/{project_id}/speakers/{speaker_id}/voice สำหรับภาษาที่รองรับการโคลนเสียง คุณยังสามารถใช้เสียงที่โคลนได้อีกด้วย
ได้ สร้าง Custom Voice Clone หนึ่งครั้งในแอป Rask โดยได้รับความยินยอมจากเจ้าของเสียง จากนั้นกำหนดรหัสเสียงให้กับผู้พูดคนใดก็ได้ผ่าน API ในภาษาที่รองรับการโคลนเสียง วิธีนี้ช่วยรักษาเสียงที่เป็นเอกลักษณ์ของแบรนด์ให้คงที่ได้ดี
เลือกจากภาษาและตัวเลือกภูมิภาคมากกว่า 135 แบบ เขียนสคริปต์ในภาษาเดียวแล้วให้ Rask แปล หรือส่งสคริปต์ที่เป็นภาษาเป้าหมายอยู่แล้ว มีเสียง AI ให้ใช้งานสำหรับทุกภาษาเป้าหมาย
API จะรับข้อความธรรมดาในแต่ละส่วน หากต้องการกำหนดการออกเสียง ให้ปรับการสะกดคำในข้อความสคริปต์ อภิธานศัพท์ใช้ควบคุมวิธีแปลคำศัพท์ ไม่ใช่วิธีออกเสียง
เสียงพูดจะเป็นไปตามเสียงที่คุณเลือกและข้อความ รวมถึงเครื่องหมายวรรคตอน หากต้องการช่วงอารมณ์ที่เหมือนกับการแสดงจริง เสียงโคลนของผู้พูดต้นฉบับจะช่วยรักษาเอกลักษณ์ของเสียงไว้ได้ดีกว่า
คุณสามารถใช้วิดีโอหรือไฟล์เสียงก็ได้ เพียงแค่อัปโหลดไฟล์ต้นฉบับและใส่สคริปต์ที่มีเวลาบอกให้ชัดเจนเพื่อสร้างเสียงพากย์ตามไทม์ไลน์ จำเป็นต้องอัปโหลดไฟล์สื่อเข้ามาด้วย
ไม่ใช่ ระบบจะคิดค่าบริการตามความยาวของวิดีโอเป็นนาที โดยปัดเศษขึ้นเป็นนาทีเต็มถัดไป ซึ่งหักจากโควตานาทีนั่นเอง สำหรับแพ็กเกจมาตรฐานที่รองรับ จะมีค่าใช้จ่ายเพิ่มเติม $3 ต่อนาที ส่วนราคาสำหรับองค์กรจะปรับเปลี่ยนไปตามข้อตกลงของคุณ สำหรับการพากย์เสียงทับ จะคิดค่าบริการเฉพาะส่วนที่มีการแก้ไข โดยมีขั้นต่ำหนึ่งนาทีต่อการเรียกใช้งานที่คิดเงิน
เริ่มต้นใช้งานด้วยการทดลองใช้ฟรีในแอป Rask โดยไม่ต้องใช้บัตรเครดิต เพื่อทดลองฟังเสียงพากย์บนวิดีโอของคุณเอง คุณสามารถใช้งาน API ได้ในแพ็กเกจ Creator Pro, Business และ Enterprise โดยฟีเจอร์จะขึ้นอยู่กับแพ็กเกจที่คุณเลือก
สามารถใช้งาน API ได้ในแพ็กเกจ Creator Pro, Business และ Enterprise โดยความสามารถจะขึ้นอยู่กับแพ็กเกจที่คุณเลือก คุณสามารถสร้างคีย์ API ในแอปและเริ่มใช้งานได้ทันที สำหรับเงื่อนไขของระดับ Enterprise, ส่วนลดตามปริมาณการใช้งาน และภาษาพิเศษ โปรดติดต่อทีมงานของเรา