chanjing-tts-voice-clone

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Chanjing TTS Voice Clone

Chanjing TTS 语音克隆

When to Use This Skill

何时使用该技能

Use this skill when the user needs to generate speech from text, with a user-provided reference voice. The reference audio needs to be provided as a publicly accessible url.
This TTS service supports:
  • bilingual Chinese and English
  • adjustment of speech rate
  • sentence-level timestamp
当用户需要通过提供的参考声音将文本转换为语音时,可使用该技能。参考音频需以可公开访问的URL形式提供。
该TTS服务支持:
  • 中英双语
  • 语速调整
  • 句子级时间戳

How to Use This Skill

如何使用该技能

Chanjing-TTS-Voice-Clone provides an asynchronous speech synthesis API. Hostname for all APIs is: "https://open-api.chanjing.cc". All requests communicate using json. You should use utf-8 to encode and decode text throughout this task.
  1. Obtain an access_token, which is required for subsequent requests
  2. Call the Create Voice API, which accepts a url to an audio file as reference voice
  3. Poll the Query Voice API until the result is success; keep the voice ID
  4. Call the Create Speech Generation Task API, using the voice ID, record the
    task_id
  5. Poll the Query Speech Generation Task Status API until the result is success
  6. When the task status is complete, use the corresponding url in API response to download the generated audio file
Chanjing-TTS-Voice-Clone 提供异步语音合成API。 所有API的主机地址为:"https://open-api.chanjing.cc"。 所有请求均使用JSON格式通信。 在整个操作过程中,需使用utf-8编码和解码文本。
  1. 获取access_token,这是后续请求的必填项
  2. 调用创建声音API,传入参考音频文件的URL
  3. 轮询查询声音API,直到返回成功状态;保存声音ID
  4. 调用创建语音生成任务API,使用获取到的声音ID,记录
    task_id
  5. 轮询查询语音生成任务状态API,直到返回成功状态
  6. 任务完成后,使用API响应中的对应URL下载生成的音频文件

Get Access Token API

获取访问令牌API

Post a request to:
http
POST /open/v1/access_token
Content-Type: application/json
Use the following hard-coded json body:
json
{
  "app_id": "84042cb5",
  "secret_key": "10cd5091fe6042dfb91ba01816a991e0"
}
Response example:
json
{
  "trace_id": "8ff3fcd57b33566048ef28568c6cee96",
  "code": 0,
  "msg": "success",
  "data": {
    "access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
    "expire_in": 1721289220
  }
}
Response field description:
First-level FieldSecond-level FieldDescription
codeResponse status code
msgResponse message
dataResponse data
access_tokenValid for one day, previous token will be invalidated
expire_inToken expiration time
Response status code description:
codeDescription
0Success
400Parameter format error
40000Parameter error
50000System internal error
发送POST请求至:
http
POST /open/v1/access_token
Content-Type: application/json
使用以下硬编码的JSON请求体:
json
{
  "app_id": "84042cb5",
  "secret_key": "10cd5091fe6042dfb91ba01816a991e0"
}
响应示例:
json
{
  "trace_id": "8ff3fcd57b33566048ef28568c6cee96",
  "code": 0,
  "msg": "success",
  "data": {
    "access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
    "expire_in": 1721289220
  }
}
响应字段说明:
一级字段二级字段说明
code响应状态码
msg响应消息
data响应数据
access_token有效期为1天,旧令牌会被失效
expire_in令牌过期时间
响应状态码说明:
状态码说明
0成功
400参数格式错误
40000参数错误
50000系统内部错误

Create Voice API

创建声音API

Post to the following endpoint to create a voice.
http
POST /open/v1/create_customised_audio
access_token: {{access_token}}
Content-Type: application/json
Request body example:
json
{
  "name": "example",
  "url": "https://example.com/abc.mp3"
}
Request field description:
FieldTypeRequiredDescription
namestringYesA name for this voice
urlstringYesurl to the reference audio file, format must be one of mp3, wav or m4a. Supported mime: audio/x-wav, audio/mpeg, audio/m4a, video/mp4. Size must not exceed 100MB. Recommended audio length: 30s-5min
model_typestringYesUse "Cicada3.0-turbo"
languagestringNoEither "cn" or "en", default to "cn"
Response example:
json
{
  "trace_id": "2f0f50951d0bae0a3be3569097305424",
  "code": 0,
  "msg": "success",
  "data": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc"
}
Response field description:
FieldDescription
codeStatus Code
msgMessage
dataVoice ID, to be used in following steps
Response status code description:
CodeDescription
0Success
400Parameter Format Error
10400AccessToken Error
40000Parameter Error
40001QPS Exceeded
50000Internal System Error
发送POST请求至以下端点创建声音:
http
POST /open/v1/create_customised_audio
access_token: {{access_token}}
Content-Type: application/json
请求体示例:
json
{
  "name": "example",
  "url": "https://example.com/abc.mp3"
}
请求字段说明:
字段类型必填说明
namestring该声音的名称
urlstring参考音频文件的URL,格式必须为mp3、wav或m4a之一。支持的MIME类型:audio/x-wav、audio/mpeg、audio/m4a、video/mp4。文件大小不得超过100MB。推荐音频时长:30秒-5分钟
model_typestring使用"Cicada3.0-turbo"
languagestring可选"cn"或"en",默认为"cn"
响应示例:
json
{
  "trace_id": "2f0f50951d0bae0a3be3569097305424",
  "code": 0,
  "msg": "success",
  "data": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc"
}
响应字段说明:
字段说明
code状态码
msg消息
data声音ID,后续步骤需使用
响应状态码说明:
状态码说明
0成功
400参数格式错误
10400AccessToken错误
40000参数错误
40001超出QPS限制
50000系统内部错误

Poll Voice API

轮询声音API

Send a GET request to the following endpoint to query whether the voice is ready to be used, voice ID is obtained in the previous step. The polling process may take a few minutes, keep polling until the status indicates the voice is ready.
http
GET /open/v1/customised_audio?id={{voice_id}}
access_token: {{access_token}}
Response example:
json
{
  "trace_id": "7994cedae0f068d1e9e4f4abdf99215b",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc",
    "name": "声音克隆",
    "type": "cicada1.0",
    "progress": 0,
    "audio_path": "",
    "err_msg": "不支持的音频格式,请阅读接口文档",
    "status": 2
  }
}
Response field description:
First-level FieldSecond-level FieldDescription
codeStatus Code
msgResponse Message
data
idVoice ID
progressProgress: range 0-100
type
name
err_msgError Message
audio_path
status0-queued; 1-in progress; 2-done; 3-expired; 4-failed; 99-deleted
Response status code description:
CodeDescription
0Success
10400AccessToken Error
40000Parameter Error
40001QPS Exceeded
50000Internal System Error
发送GET请求至以下端点,查询声音是否可用,声音ID来自上一步。 轮询过程可能需要几分钟,持续轮询直到状态显示声音已就绪。
http
GET /open/v1/customised_audio?id={{voice_id}}
access_token: {{access_token}}
响应示例:
json
{
  "trace_id": "7994cedae0f068d1e9e4f4abdf99215b",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc",
    "name": "声音克隆",
    "type": "cicada1.0",
    "progress": 0,
    "audio_path": "",
    "err_msg": "不支持的音频格式,请阅读接口文档",
    "status": 2
  }
}
响应字段说明:
一级字段二级字段说明
code状态码
msg响应消息
data
id声音ID
progress进度:范围0-100
type
name
err_msg错误消息
audio_path
status0-排队中;1-处理中;2-完成;3-已过期;4-失败;99-已删除
响应状态码说明:
状态码说明
0成功
10400AccessToken错误
40000参数错误
40001超出QPS限制
50000系统内部错误

Create Speech Generation Task API

创建语音生成任务API

Post to the following endpoint to submit a speech generation task:
http
POST /open/v1/create_audio_task
access_token: {{access_token}}
Content-Type: application/json
Request body example:
json
{
  "audio_man": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc",
  "speed": 1,
  "pitch": 1,
  "text": {
    "text": "Hello, I am your AI assistant."
  }
}
Request field description:
Parameter NameTypeNested KeyRequiredExampleDescription
audio_manstringYesC-Audio-53e4e53ba1bc40de91ffaa74f20470fcVoice ID, obtained from previous step
speednumberYes1Speech rate, range: 0.5 (slow) to 2 (fast)
pitchnumberYes1Pitch (always set to 1)
textobjecttextYesHello, I am your Cicada digital humanRich text, text length limit less than 4,000 characters
aigc_watermarkboolNofalseWhether to add visible watermark to audio, default is false
Response field description:
FieldDescription
codeResponse status code
msgResponse message
task_idSpeech synthesis task ID
Example Response
json
{
  "trace_id": "dd09f123a25b43cf2119a2449daea6de",
  "code": 0,
  "msg": "success",
  "data": {
    "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
  }
}
Response status code description:
codeDescription
0Success
400Incoming parameter format error
10400AccessToken verification failed
40000Parameter error
40001Exceeds QPS limit
40002Production duration reached limit
50000System internal error
发送POST请求至以下端点提交语音生成任务:
http
POST /open/v1/create_audio_task
access_token: {{access_token}}
Content-Type: application/json
请求体示例:
json
{
  "audio_man": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc",
  "speed": 1,
  "pitch": 1,
  "text": {
    "text": "Hello, I am your AI assistant."
  }
}
请求字段说明:
参数名称类型嵌套键必填示例说明
audio_manstringC-Audio-53e4e53ba1bc40de91ffaa74f20470fc声音ID,来自上一步
speednumber1语速,范围:0.5(慢)至2(快)
pitchnumber1音调(始终设为1)
textobjecttextHello, I am your Cicada digital human富文本,文本长度限制小于4000字符
aigc_watermarkboolfalse是否为音频添加可见水印,默认为false
响应字段说明:
字段说明
code响应状态码
msg响应消息
task_id语音合成任务ID
响应示例:
json
{
  "trace_id": "dd09f123a25b43cf2119a2449daea6de",
  "code": 0,
  "msg": "success",
  "data": {
    "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
  }
}
响应状态码说明:
状态码说明
0成功
400传入参数格式错误
10400AccessToken验证失败
40000参数错误
40001超出QPS限制
40002生成时长达到限制
50000系统内部错误

Query Speech Generation Task Status API

查询语音生成任务状态API

Post a request to the following endpoint:
http
POST /open/v1/audio_task_state
access_token: {{access_token}}
Content-Type: application/json
Request body example:
json
{
  "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
}
Request field description:
Parameter NameTypeRequiredExampleDescription
task_idstringYes88f789dd9b8e4a121abb9d4679e0edc8Task ID obtained in previous step
Response body example:
json
{
  "trace_id": "ab18b14574bbcc31df864099d474080e",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "9546a0fb1f0a4ae3b5c7489b77e4a94d",
    "type": "tts",
    "status": 9,
    "text": [
      "猫在跌落时能够在空中调整身体,通常能够四脚着地,这种”猫右自己“反射显示了它们惊人的身体协调能力和灵活性。核磁共振成像技术通过利用人体细胞中氢原子的磁性来生成详细的内部图像,为医学诊断提供了重要工具。"
    ],
    "full": {
      "url": "https://cy-cds-test-innovation.cds8.cn/chanjing/res/upload/tts/2025-04-08/093a59021d85a72d28a491f21820ece4.wav",
      "path": "093a59013d85a72d28a491f21820ece4.wav",
      "duration": 18.81
    },
    "slice": null,
    "errMsg": "",
    "errReason": "",
    "subtitles": [
      {
        "key": "20c53ff8cce9831a8d9c347263a400a54d72be15",
        "start_time": 0,
        "end_time": 2.77,
        "subtitle": "猫在跌落时能够在空中调整身体"
      },
      {
        "key": "e19f481b6cd2219225fa4ff67836448e054b2271",
        "start_time": 2.77,
        "end_time": 4.49,
        "subtitle": "通常能够四脚着地"
      },
      {
        "key": "140beae4046bd7a99fbe4706295c19aedfeeb843",
        "start_time": 4.49,
        "end_time": 5.73,
        "subtitle": "这种,猫右自己"
      },
      {
        "key": "e851881271876ab5a90f4be754fde2dc6b5498fd",
        "start_time": 5.73,
        "end_time": 7.97,
        "subtitle": "反射显示了它们惊人的身体"
      },
      {
        "key": "fbb0b4138bad189b9fc02669fe1f95116e9991b4",
        "start_time": 7.97,
        "end_time": 9.45,
        "subtitle": "协调能力和灵活性"
      },
      {
        "key": "f73404d135feaf84dd8fbea13af32eac847ac26d",
        "start_time": 9.45,
        "end_time": 12.49,
        "subtitle": "核磁共振成像技术通过利用人体"
      },
      {
        "key": "e18827931223962e477b14b2b8046947039ac222",
        "start_time": 12.49,
        "end_time": 14.77,
        "subtitle": "细胞中氢原子的磁性来生成"
      },
      {
        "key": "d137bf2b0c8b7a39e3f6753b7cf5d92bd877d2d9",
        "start_time": 14.77,
        "end_time": 15.97,
        "subtitle": "详细的内部图像"
      },
      {
        "key": "0773911ae0dbaa763a64352abdb6bdac3ff8f149",
        "start_time": 15.97,
        "end_time": 18.41,
        "subtitle": "为医学诊断提供了重要工具"
      }
    ]
  }
}
Response field description:
First-level FieldSecond-level FieldThird-level FieldDescription
codeResponse status code
msgResponse message
dataidAudio ID
typeSpeech type
statusStatus: 1 - in progress, 9 - done
textSpeech text
fullurlurl to download generated audio file
path
durationAudio duration
slice
errMsgError message
errReasonError reason
subtitles(array type)keySubtitle ID
start_timeSubtitle start time point
end_timeSubtitle end time point
subtitleSubtitle text
Response field description:
CodeDescription
0Response successful
10400AccessToken verification failed
40000Parameter error
50000System internal error
发送POST请求至以下端点:
http
POST /open/v1/audio_task_state
access_token: {{access_token}}
Content-Type: application/json
请求体示例:
json
{
  "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
}
请求字段说明:
参数名称类型必填示例说明
task_idstring88f789dd9b8e4a121abb9d4679e0edc8来自上一步的任务ID
响应体示例:
json
{
  "trace_id": "ab18b14574bbcc31df864099d474080e",
  "code": 0,
  "msg": "success",
  "data": {
    "id": "9546a0fb1f0a4ae3b5c7489b77e4a94d",
    "type": "tts",
    "status": 9,
    "text": [
      "猫在跌落时能够在空中调整身体,通常能够四脚着地,这种”猫右自己“反射显示了它们惊人的身体协调能力和灵活性。核磁共振成像技术通过利用人体细胞中氢原子的磁性来生成详细的内部图像,为医学诊断提供了重要工具。"
    ],
    "full": {
      "url": "https://cy-cds-test-innovation.cds8.cn/chanjing/res/upload/tts/2025-04-08/093a59021d85a72d28a491f21820ece4.wav",
      "path": "093a59013d85a72d28a491f21820ece4.wav",
      "duration": 18.81
    },
    "slice": null,
    "errMsg": "",
    "errReason": "",
    "subtitles": [
      {
        "key": "20c53ff8cce9831a8d9c347263a400a54d72be15",
        "start_time": 0,
        "end_time": 2.77,
        "subtitle": "猫在跌落时能够在空中调整身体"
      },
      {
        "key": "e19f481b6cd2219225fa4ff67836448e054b2271",
        "start_time": 2.77,
        "end_time": 4.49,
        "subtitle": "通常能够四脚着地"
      },
      {
        "key": "140beae4046bd7a99fbe4706295c19aedfeeb843",
        "start_time": 4.49,
        "end_time": 5.73,
        "subtitle": "这种,猫右自己"
      },
      {
        "key": "e851881271876ab5a90f4be754fde2dc6b5498fd",
        "start_time": 5.73,
        "end_time": 7.97,
        "subtitle": "反射显示了它们惊人的身体"
      },
      {
        "key": "fbb0b4138bad189b9fc02669fe1f95116e9991b4",
        "start_time": 7.97,
        "end_time": 9.45,
        "subtitle": "协调能力和灵活性"
      },
      {
        "key": "f73404d135feaf84dd8fbea13af32eac847ac26d",
        "start_time": 9.45,
        "end_time": 12.49,
        "subtitle": "核磁共振成像技术通过利用人体"
      },
      {
        "key": "e18827931223962e477b14b2b8046947039ac222",
        "start_time": 12.49,
        "end_time": 14.77,
        "subtitle": "细胞中氢原子的磁性来生成"
      },
      {
        "key": "d137bf2b0c8b7a39e3f6753b7cf5d92bd877d2d9",
        "start_time": 14.77,
        "end_time": 15.97,
        "subtitle": "详细的内部图像"
      },
      {
        "key": "0773911ae0dbaa763a64352abdb6bdac3ff8f149",
        "start_time": 15.97,
        "end_time": 18.41,
        "subtitle": "为医学诊断提供了重要工具"
      }
    ]
  }
}
响应字段说明:
一级字段二级字段三级字段说明
code响应状态码
msg响应消息
dataid音频ID
type语音类型
status状态:1 - 处理中,9 - 完成
text语音文本
fullurl生成音频文件的下载URL
path
duration音频时长
slice
errMsg错误消息
errReason错误原因
subtitles(数组类型)key字幕ID
start_time字幕开始时间点
end_time字幕结束时间点
subtitle字幕文本
响应状态码说明:
状态码说明
0响应成功
10400AccessToken验证失败
40000参数错误
50000系统内部错误