# 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通过文件或支持的媒体网址,上传与配音相关的视频或音频录音。其时间轴将为您的剧本提供时间参考。
使用带有时间戳和发言人的文本片段创建字幕,或使用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,因此后续的修改绝不会悄悄改变已完成的工作。是的,适用于视频配音。将您的脚本作为带有时间戳的文本段或SRT文件与视频一起发送,API便会生成与画面完美同步、自然流畅的语音。您可以使用人工智能声音或语音克隆,并在同一个项目中生成字幕和音轨。
Rask为完整项目生成语音并交付文件,非常适合已完成的视频、培训和营销内容。对于需要几秒内获得音频的语音代理、呼叫中心及其他低延迟应用,流式文字转语音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 为每个说话者分配声音。在支持语音克隆的语言中,您还可以使用声音克隆功能。
可以。在取得发言人同意后,在Rask应用中创建一次自定义语音克隆,然后即可在支持的语音克隆语言中通过API将其声音ID分配给任何发言人。这非常适合作为连贯的品牌声音。
提供 135 种以上的语言和地区选项可供选择。您可以选择使用一种语言编写脚本并由Rask进行翻译,也可以直接发送目标语言的脚本。每个目标区域都提供人工智能声音。
该API按段落接收纯文本。如需指导发音,请调整脚本文字中的拼写。术语表用于控制术语的翻译方式,而不是发音方式。
语音表现取决于所选的声音以及您的文本(包括标点符号)。若要获得匹配真实表现的情感跨度,原说话者的语音克隆能够更好地保留其声音特色。
您可以使用视频或音频录音。上传原始素材并提供带时间轴的脚本,即可在相应时间点生成配音。必须上传媒体文件。
不是的。使用量按视频分钟数计费,向上取整到整分钟,并从 Rask 应用的同一分钟数额度中扣除。符合条件标准版套餐的超出分钟数按每分钟 3 美元收费。企业版价格根据您的协议量身定制。重新配音根据更改的片段计费,每次收费运行至少计一分钟。
您可以在 Rask 应用中开始免费试用,无需绑定银行卡,即可在您自己的视频上聆听配音效果。Creator Pro、Business 和 Enterprise 套餐均提供 API 访问权限,具体功能由您的套餐决定。
API 访问权限适用于创作者专业版、商业版和企业版套餐,具体功能由您的套餐决定。您可以在应用中创建 API 密钥并立即开始调用。企业条款、大宗定价和自定义语言覆盖范围请联系我们的团队咨询。