Dubbing

GET

Parameters

Header parameters

NameDescription
dupdub_tokenYour DupDub token
Content-Typeapplication/json

Query parameters

NameTypeDescription
speakerstring | required​Identifier for the speaker whose voice will be used. Get from /v1/storeSpeakerV2/searchSpeakerList
speedstring | optional​Speed of the speech. Default is normal speed (1.0)
pitchstring | optional​Pitch of the speech. Default is standard pitch (0)
textListstring [ ] | requiredList of text segments to be dubbed. Each item is a string

Response

NameTypeDescription
dataobjectThe container object for the response data.
├ resList object [ ]Array containing results for each text segment processed
├─ successbooleanIndicates if the dubbing operation was successful
├─ codeintegerStatus code related to the dubbing operation
├─ messagestringDetailed message or information about the operation
├─ lengthintegerLength of the request in characters
├─ resultobjectContainer for detailed results of the operation
├─ duration_addressstringURL or path to the audio duration information
├─ lengthOfTimenumberDuration of the generated audio in seconds
├─ ossFilestringURL or path to the audio file
├─ sizeintegerSize of the generated audio file (bytes)
├─ srt_addressstringURL or path to the subtitle (SRT) file, if generated
codeintegerResponse 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
messagestringA 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