-
Getting Started
-
Video Translation
-
AI Avatar
-
AI Voiceover
-
AI Transcription
Dubbing
Updated2024 年 5 月 20 日
GET
Parameters
Header parameters
Name | Description |
---|---|
dupdub_token | Your DupDub token |
Content-Type | application/json |
Query parameters
Name | Type | Description |
---|---|---|
speaker | string | required | Identifier for the speaker whose voice will be used. Get from /v1/storeSpeakerV2/searchSpeakerList |
speed | string | optional | Speed of the speech. Default is normal speed (1.0) |
pitch | string | optional | Pitch of the speech. Default is standard pitch (0) |
textList | string [ ] | required | List of text segments to be dubbed. Each item is a string |
Response
Name | Type | Description |
---|---|---|
data | object | The container object for the response data. |
├ resList | object [ ] | Array containing results for each text segment processed |
├─ success | boolean | Indicates if the dubbing operation was successful |
├─ code | integer | Status code related to the dubbing operation |
├─ message | string | Detailed message or information about the operation |
├─ length | integer | Length of the request in characters |
├─ result | object | Container for detailed results of the operation |
├─ duration_address | string | URL or path to the audio duration information |
├─ lengthOfTime | number | Duration of the generated audio in seconds |
├─ ossFile | string | URL or path to the audio file |
├─ size | integer | Size of the generated audio file (bytes) |
├─ srt_address | string | URL or path to the subtitle (SRT) file, if generated |
code | integer | Response code indicating success or failure 200: Succeed 400: Parameter validation failed 403: No relevant permissions 500: Failed 502: Gateway service exception 2001: Login failed, please login again |
message | string | A message providing additional information about the response code |
Sample Codes
Request
import requests
# API endpoint for query the AI avatar project status
url = "https://moyin-gateway.dupdub.com/tts/v1/playDemo/dubForSpeaker"
# Your API key
api_key = "<<Your DupDub API Key>>"
headers = {
"dupdub_token": f"{api_key}",
"Content-Type": "application/json"
}
payload = {
"speaker": "mercury_jane@hopeful",
"speed": "1.5",
"pitch": "1.0",
"textList": ["this is a simple test"]
}
response = requests.post(url, json=payload, headers=headers)
# Parse the response
if response.status_code == 200:
result = response.json()
print(result)
else:
print("Failed to synthesis speech. Status Code:", response.status_code)
Response
{
'code': 200,
'message': 'OK',
'data': {
'resList': [
{
'success': True,
'code': 200,
'message': 'Succeed',
'length': 21,
'result': {
'duration_address': 'https://oci-useast-ohio-speech-public.dupdub.com/mobvoi-tts/voice-maker/duration/null/1711372316698/3c49a4d5d2eadd6a5472d24734898d07.json?v=1711372316862',
'lengthOfTime': 1.890125,
'message': 'ok',
'ossFile': 'https://oci-useast-ohio-speech-public.dupdub.com/mobvoi-tts/voice-maker/synthesis_audio/null/1711372316698/3c49a4d5d2eadd6a5472d24734898d07.wav',
'size': '90770',
'srt_address': 'https://oci-useast-ohio-speech-public.dupdub.com/mobvoi-tts/voice-maker/subtitle/null/1711372316698/3c49a4d5d2eadd6a5472d24734898d07.srt?v=1711372317113',
}
}
]
}
}
Table of Contents