Được tin cậy bởi hơn 500.000+ người dùng
Các tính năng mạnh mẽ của API
Tất cả những gì bạn cần để tích hợp dịch thuật AI chuyên nghiệp vào ứng dụng của mình.Phạm vi toàn cầu
33+ ngôn ngữ
Hỗ trợ các ngôn ngữ phổ biến nhất trên thế giới, bao gồm Tiếng Anh, Tiếng Bồ Đào Nha, Tiếng Tây Ban Nha, Tiếng Pháp, Tiếng Đức, Tiếng Trung, Tiếng Nhật và nhiều ngôn ngữ khác.Giọng nói chân thực
Sao chép giọng nói
Bảo toàn giọng nói gốc của người nói bằng công nghệ nhân bản giọng nói AI tiên tiến để đạt được kết quả lồng tiếng chân thực.Nhanh chóng và Đáng tin cậy
Xử lý nhanh chóng
Hoàn thành các dự án lồng tiếng của bạn trong vài phút, không phải vài giờ. Nhận kết quả nhanh chóng với quy trình xử lý AI tối ưu hóa của chúng tôi.99.9%
Uptime
<300ms
Thời gian phản hồi
24/7
Hỗ trợ
Quy trình làm việc của API lồng tiếng AI
Tích hợp tính năng lồng tiếng bằng trí tuệ nhân tạo (AI) vào ứng dụng của bạn chỉ với vài lệnh gọi API.01
Lấy URL tải lên và tải lên tệp
Nhận URL đã được ký sẵn qua API, sau đó tải lên tệp video của bạn bằng yêu cầu PUT. Hỗ trợ các định dạng MP4, MOV, AVI và nhiều định dạng khác.API Request
# 1. Get upload URL
curl -X GET "https://dubsmart.ai/api/v1/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"region": "EU",
"fileExtension": "mp4"
}'
# 2. Upload file using returned URL
curl -X PUT "PRESIGNED_URL_FROM_STEP_1" \
-H "Content-Type: video/mp4" \
--data-binary @video.mp402
Tạo dự án
Tạo dự án lồng tiếng với các ngôn ngữ đích và cài đặt giọng nói. Hỗ trợ nhiều ngôn ngữ trong một yêu cầu.API Request
curl -X POST "https://dubsmart.ai/api/v1/project" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {"path": "uploaded_file_key"},
"targetLanguages": ["es", "fr", "de"],
"voice": "voiceCloning"
}'03
Chỉnh sửa dự án
Chỉnh sửa cài đặt dự án, tiêu đề, người thuyết trình và âm lượng nền theo nhu cầu.API Request
curl --request PUT \
--url https://dubsmart.ai/api/v1/project \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"title": "Updated Project Title",
"speakers": [
"Speaker 1",
"Speaker 2"
],
"backgroundVolume": 0.5,
"id": "64f8a2b1c3d4e5f6a7b8c9d0"
}'04
Tải xuống kết quả
Tải xuống các tệp video hoặc âm thanh đã lồng tiếng. Tải xuống các đoạn riêng lẻ hoặc nội dung lồng tiếng hoàn chỉnh.API Request
curl -X GET "https://dubsmart.ai/api/v1/project/PROJECT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"Các điểm cuối API lồng tiếng bằng trí tuệ nhân tạo (AI)
Tài liệu tham khảo API đầy đủ kèm ví dụ cho tất cả các điểm cuốiGET
/uploadLấy URL tệp tin để tải lên
Nhận URL đã được ký sẵn cho việc tải lên tệp và trả về khóa tệp.Request
JSON
{
"region": "EU",
"fileExtension": "mp4"
}Response
JSON
{
"url": "https://storage.dubsmart.ai/...",
"key": "uploads/user_id/filename.mp4"
}POST
/voicesThu âm giọng nói
Tìm kiếm các giọng nói AI có sẵn với các tùy chọn lọc.Request
JSON
{
"limit": 50,
"filter": {
"language": "en",
"gender": "female",
"accent": "american"
}
}Response
JSON
{
"items": [
{
"id": "voice_id_1",
"name": "Anna",
"value": "anna_en_v2",
"language": "en",
"provider": "elevenlabs"
}
],
"nextCursor": "next_cursor_value"
}POST
/custom-voicesNhận giọng nói tùy chỉnh
Lấy các giọng nói tùy chỉnh do người dùng tạo raRequest
JSON
{
"limit": 10,
"cursor": "cursor_value"
}Response
JSON
{
"items": [
{
"id": "custom_voice_id",
"name": "My Custom Voice",
"examplePath": "https://..."
}
],
"nextCursor": "next_cursor_value"
}POST
/projectTạo dự án
Tạo một dự án lồng tiếng mới với tệp video và các ngôn ngữ đích.Request
JSON
{
"input": {
"path": "uploaded_file_key",
"type": "LOCAL_FILE",
"voice": "voiceCloning",
"textCheck": false
},
"targetLanguages": ["es", "fr", "de"],
"title": "My Dubbing Project",
"speakersAmount": 2
}Response
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d0",
"groupId": "64f8a2b1c3d4e5f6a7b8c9d1",
"base": {
"title": "My Dubbing Project",
"state": "Pending",
"progress": 0
},
"targetLanguage": "es",
"groupProjects": [
{"id": "64f8a2b1c3d4e5f6a7b8c9d0", "targetLanguage": "es"},
{"id": "64f8a2b1c3d4e5f6a7b8c9d2", "targetLanguage": "fr"},
{"id": "64f8a2b1c3d4e5f6a7b8c9d3", "targetLanguage": "de"}
]
}GET
/projectNhận dự án
Lấy danh sách tất cả các dự án lồng tiếng có phân trangRequest
JSON
{
"cursor": "64f8a2b1c3d4e5f6a7b8c9d0",
"limit": 10
}Response
JSON
{
"items": [
{
"id": "64f8a2b1c3d4e5f6a7b8c9d0",
"base": {
"title": "My Dubbing Project",
"state": "Done",
"progress": 100
},
"targetLanguage": "es",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"nextCursor": "64f8a2b1c3d4e5f6a7b8c9d4"
}PUT
/projectChỉnh sửa dự án
Cập nhật cài đặt dự án, tiêu đề, người thuyết trình và âm lượng nền.Request
JSON
{
"title": "Updated Project Title",
"speakers": [
"Speaker 1",
"Speaker 2"
],
"backgroundVolume": 0.5,
"id": "64f8a2b1c3d4e5f6a7b8c9d0"
}Response
JSON
trueDELETE
/projectXóa dự án
Xóa vĩnh viễn một dự án lồng tiếngRequest
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d0"
}Response
JSON
trueGET
/project/{id}Lấy dự án theo ID
Nhận thông tin chi tiết về một dự án cụ thể bao gồm các phân đoạn.Request
JSON
GET /project/64f8a2b1c3d4e5f6a7b8c9d0Response
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d0",
"base": {
"title": "My Dubbing Project",
"state": "Done",
"progress": 100
},
"segments": [
{
"id": "64f8a2b1c3d4e5f6a7b8c9d5",
"text": "Hello world",
"translatedText": "Hola mundo",
"start": 0.0,
"end": 1.5,
"speakerId": 0,
"resultUrl": "https://..."
}
],
"videoResult": {
"value": "https://...",
"state": "Done"
}
}POST
/project/regenerateTái tạo dự án
Tái tạo âm thanh cho toàn bộ dự án hoặc các đoạn cụ thể.Request
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d0",
"segmentsForRegenerating": ["segment_id_1", "segment_id_2"],
"cloneVoice": true
}Response
JSON
truePOST
/project/speakerThêm loa
Thêm một diễn giả mới vào dự ánRequest
JSON
{
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0",
"voice": "voice_id"
}Response
JSON
200 OKDELETE
/project/speakerTháo loa
Xóa một loa khỏi dự ánRequest
JSON
{
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0",
"speakerId": 0
}Response
JSON
200 OKPOST
/segmentTạo phân đoạn
Thêm một đoạn thoại mới vào dự án hiện có.Request
JSON
{
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0",
"text": "New segment text",
"translatedText": "Texto del nuevo segmento",
"start": 10.5,
"end": 12.0,
"speakerId": 0,
"voice": "voiceCloning"
}Response
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d6",
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0",
"text": "New segment text",
"translatedText": "Texto del nuevo segmento",
"start": 10.5,
"end": 12.0,
"speakerId": 0,
"state": "Pending"
}PUT
/segmentChỉnh sửa đoạn
Cập nhật văn bản, thời gian hoặc thông số giọng nói của đoạn văn bản.Request
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d6",
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0",
"text": "Updated segment text",
"translatedText": "Texto actualizado del segmento",
"start": 10.0,
"end": 12.5,
"speakerId": 0,
"voice": "voiceCloning"
}Response
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d6",
"text": "Updated segment text",
"translatedText": "Texto actualizado del segmento",
"start": 10.0,
"end": 12.5,
"speakerId": 0,
"state": "Pending"
}DELETE
/segmentXóa đoạn
Xóa một đoạn thoại khỏi dự án bằng IDRequest
JSON
{
"id": "64f8a2b1c3d4e5f6a7b8c9d6",
"projectId": "64f8a2b1c3d4e5f6a7b8c9d0"
}Response
JSON
trueVí dụ mã nguồn API lồng tiếng bằng Trí tuệ nhân tạo (AI)
Các ví dụ mã nguồn sẵn sàng sử dụng trong nhiều ngôn ngữ lập trìnhJavaScript Example
// JavaScript/Node.js Example
const axios = require('axios');
const fs = require('fs');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://dubsmart.ai/api/v1';
async function createDubbingProject() {
try {
// 1. Get upload URL
const uploadResponse = await axios.get(`${BASE_URL}/upload`, {
params: {
region: 'EU',
fileExtension: 'mp4'
},
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
// 2. Upload file using presigned URL
const fileBuffer = fs.readFileSync('video.mp4');
await axios.put(uploadResponse.data.url, fileBuffer, {
headers: {
'Content-Type': 'video/mp4'
}
});
// 3. Create dubbing project
const projectResponse = await axios.post(`${BASE_URL}/project`, {
input: {
path: uploadResponse.data.key,
type: 'LOCAL_FILE',
voice: 'voiceCloning',
textCheck: false
},
targetLanguages: ['es', 'fr', 'de'],
title: 'My Multilingual Video'
}, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
console.log('Project created:', projectResponse.data);
return projectResponse.data;
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
// Monitor project status
async function checkProjectStatus(projectId) {
const response = await axios.get(`${BASE_URL}/project/${projectId}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
return response.data;
}Python Example
# Python Example
import requests
import time
API_KEY = 'your_api_key_here'
BASE_URL = 'https://dubsmart.ai/api/v1'
def create_dubbing_project():
headers = {'Authorization': f'Bearer {API_KEY}'}
try:
# 1. Get upload URL
upload_params = {
'region': 'EU',
'fileExtension': 'mp4'
}
upload_response = requests.get(
f'{BASE_URL}/upload',
params=upload_params,
headers=headers
)
upload_response.raise_for_status()
# 2. Upload file using presigned URL
with open('video.mp4', 'rb') as file:
upload_file_response = requests.put(
upload_response.json()['url'],
data=file,
headers={'Content-Type': 'video/mp4'}
)
upload_file_response.raise_for_status()
# 3. Create dubbing project
project_data = {
'input': {
'path': upload_response.json()['key'],
'type': 'LOCAL_FILE',
'voice': 'voiceCloning',
'textCheck': False
},
'targetLanguages': ['es', 'fr', 'de'],
'title': 'My Multilingual Video'
}
project_response = requests.post(
f'{BASE_URL}/project',
json=project_data,
headers=headers
)
project_response.raise_for_status()
print('Project created:', project_response.json())
return project_response.json()
except requests.exceptions.RequestException as e:
print(f'Error: {e}')
return None
def monitor_project(project_id):
headers = {'Authorization': f'Bearer {API_KEY}'}
while True:
response = requests.get(
f'{BASE_URL}/project/{project_id}',
headers=headers
)
response.raise_for_status()
project = response.json()
status = project['base']['state']
print(f'Project status: {status}')
if status == 'Done':
print('Project completed!')
return project
elif status == 'Error':
print('Project failed!')
return None
time.sleep(30) # Check every 30 secondscURL Example
# cURL Examples
# 1. Get upload URL
curl -X GET "https://dubsmart.ai/api/v1/upload?region=EU&fileExtension=mp4" \
-H "Authorization: Bearer YOUR_API_KEY"
# 2. Upload file using presigned URL
curl -X PUT "PRESIGNED_URL_FROM_STEP_1" \
-H "Content-Type: video/mp4" \
--data-binary @video.mp4
# 3. Create dubbing project
curl -X POST "https://dubsmart.ai/api/v1/project" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"path": "uploaded_file_key",
"type": "LOCAL_FILE",
"voice": "voiceCloning",
"textCheck": false
},
"targetLanguages": ["es", "fr", "de"],
"title": "My Multilingual Video"
}'
# 4. Check project status
curl -X GET "https://dubsmart.ai/api/v1/project/PROJECT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# 5. Download results
curl -X GET "https://dubsmart.ai/api/v1/project/PROJECT_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o "dubbed_video.mp4"PHP Example
<?php
// PHP Example
$apiKey = 'your_api_key_here';
$baseUrl = 'https://dubsmart.ai/api/v1';
function createDubbingProject() {
global $apiKey, $baseUrl;
$headers = [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json'
];
try {
// 1. Get upload URL
$uploadParams = [
'region' => 'EU',
'fileExtension' => 'mp4'
];
$uploadResponse = httpRequest(
$baseUrl . '/upload?' . http_build_query($uploadParams),
'GET',
null,
$headers
);
// 2. Upload file using presigned URL
$fileContent = file_get_contents('video.mp4');
$uploadFileResponse = httpRequest(
$uploadResponse['url'],
'PUT',
$fileContent,
['Content-Type: video/mp4']
);
// 3. Create dubbing project
$projectData = [
'input' => [
'path' => $uploadResponse['key'],
'type' => 'LOCAL_FILE',
'voice' => 'voiceCloning',
'textCheck' => false
],
'targetLanguages' => ['es', 'fr', 'de'],
'title' => 'My Multilingual Video'
];
$projectResponse = httpRequest(
$baseUrl . '/project',
'POST',
$projectData,
$headers
);
echo "Project created: " . json_encode($projectResponse);
return $projectResponse;
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
return null;
}
}
function httpRequest($url, $method, $data, $headers) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if ($method === 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
} elseif ($method === 'PUT') {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode >= 200 && $httpCode < 300) {
return json_decode($response, true);
} else {
throw new Exception("HTTP Error: " . $httpCode);
}
}
// Usage
$project = createDubbingProject();
?>Câu hỏi thường gặp
API hỗ trợ các định dạng tệp nào?
API hỗ trợ tất cả các định dạng video chính bao gồm MP4, MOV, AVI, MKV, WebM và nhiều định dạng khác. Đối với tệp âm thanh, chúng tôi hỗ trợ MP3, WAV, AAC và các định dạng phổ biến khác. Kích thước tệp tối đa là 5GB.
Quá trình lồng tiếng mất bao lâu?
Thời gian xử lý phụ thuộc vào độ dài video và kích thước tệp. Một video dài 5 phút thường mất 1 phút để xử lý. Khách hàng doanh nghiệp được ưu tiên xử lý với thời gian hoàn thành nhanh hơn.
Các ngôn ngữ nào được hỗ trợ?
Chúng tôi hỗ trợ hơn 33 ngôn ngữ đích, bao gồm Tiếng Anh, Tiếng Bồ Đào Nha, Tiếng Tây Ban Nha, Tiếng Pháp, Tiếng Đức, Tiếng Trung, Tiếng Nhật, Tiếng Hàn, Tiếng Nga, Tiếng Ả Rập, Tiếng Hindi và nhiều ngôn ngữ khác. Chúng tôi cũng có thể phát hiện và xử lý nội dung từ hơn 99 ngôn ngữ nguồn.
Công nghệ sao chép giọng nói hoạt động như thế nào?
Hệ thống AI tiên tiến của chúng tôi phân tích các đặc điểm giọng nói của người nói gốc, bao gồm giọng điệu, cao độ, giọng địa phương và phong cách nói. Sau đó, nó tạo ra giọng nói tổng hợp giữ nguyên những đặc điểm độc đáo này khi nói bằng ngôn ngữ đích.
Tôi có thể chỉnh sửa nội dung đã lồng tiếng không?
Đúng vậy! API cung cấp đầy đủ các tính năng chỉnh sửa. Bạn có thể chỉnh sửa văn bản đã dịch, điều chỉnh thời gian, thay đổi giọng nói và tái tạo các đoạn cụ thể.
Tôi có thể sử dụng API cho các dự án thương mại không?
Đúng vậy! Tất cả các gói dịch vụ đều cho phép sử dụng cho mục đích thương mại. API được thiết kế cho môi trường sản xuất và được sử dụng bởi các nhà sáng tạo nội dung hàng đầu, doanh nghiệp và các công ty truyền thông trên toàn thế giới.
