当前位置: 首页 > Skill >

Chanjing Tts Voice Clone

Chanjing Tts Voice Clone

Chanjing Tts Voice Clone

使用 Chanjing TTS API 将文本合成语音,采用用户提供的音色。主要凭证为 credentials.json(包含 app_id/secret_key、access_token及其有效期等)。

1.0.3 2026.11.06 931
获取Skill文件查看使用说明
作 者:顾宁 许可证: 更新时间:2026.11.06
本文目录展开

Chanjing TTS Voice Clone

技能包标识:chanjing-tts-voice-clone。

功能说明

基于用户提供的参考音频公网 URL(由蝉镜服务端拉取)创建音色并合成语音;轮询任务并从接口返回 URL 下载结果。脚本不依赖 ffmpeg/ffprobe。机器可读凭据声明见篇首 metadata.openclaw.credentialModel。access_token 与 expire_in 会写入同一 credentials.json;刷新令牌时由本技能覆盖文件中对应字段,请勿将凭证提交到版本库。

运行依赖

  • python3 与同仓库 scripts/*.py
  • 无 ffmpeg/ffprobe 门控

环境变量

  1. CHANJING_CONFIG_DIR(可选):credentials.json 所在目录,默认 ~/.chanjing
  2. CHANJING_API_BASE(可选):Open API 基址,默认 https://open-api.chanjing.cc

使用命令

  • ClawHub(slug 以注册表为准):clawhub run chanjing-tts-voice-clone
  • 本仓库:python skills/chanjing-tts-voice-clone/scripts/create_voice.py …(见正文 How to Use)

登记摘要(英文 · ClawHub / OpenClaw)

Primary credential (not primaryEnv): app_id + secret_key in ~/.chanjing/credentials.json (or $CHANJING_CONFIG_DIR/credentials.json); access_token and expire_in read/written in the same file (overwritten on token refresh). primaryEnv omitted by design. metadata.openclaw.credentialModel is the machine-readable registry source of truth.

Required vs optional: CHANJING_API_BASE optional (default https://open-api.chanjing.cc). CHANJING_CONFIG_DIR optional. No ffmpeg/ffprobe in skill metadata.

Purpose alignment: Voice clone TTS—user-supplied public URL for reference audio (Chanjing servers fetch it); then synthesize and download from API-returned URLs. Trust API host, response URLs, and user-chosen reference URL.

See How to Use → Reviewer Q&A (four items) → Security & credentials (registry summary).

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

How to Use This Skill

前置条件(权限验证):执行本 Skill 前,必须先通过 chanjing-credentials-guard 完成 AK/SK 与 Token 校验。脚本与 guard 使用同一套凭证;无凭证时会执行 open_login_page.py 打开注册/登录页。

Reviewer Q&A (four items)

Direct answers for Purpose & Capability / Instruction Scope / Credentials / Persistence-style reviews; aligned with code, top Registry summary (English), and description frontmatter.

# Topic Answer
1 Purpose vs implementation; primary credential Aligned. Voice-clone TTS client; reference audio via user-provided public URL (server-side fetch). CHANJING_API_BASE not required. Primary credential in credentials.json; primaryEnv omitted. No ffmpeg/ffprobe in metadata.
2 Runtime scope: secrets, URLs In scope. Read/write credentials; browser if needed; HTTPS; user reference URL + output URLs from API—trust boundaries include user-chosen reference URL and API host.
3 Env vs file secrets CHANJING_* optional; app_id / secret_key / access_token / expire_in on disk—sensitive; token fields overwritten on refresh.
4 Persistence & privilege always: false default; does not modify other skills or global agent config.

Security & credentials (registry summary)

Aligned with Reviewer Q&A above, top English registry summary, and description.

Aspect Details
Primary credential Same file-based app_id / secret_key as other Chanjing skills. Not primaryEnv.
Token Refreshed and written to ~/.chanjing/credentials.json (or CHANJING_CONFIG_DIR); access_token and expire_in are overwritten when the skill refreshes the token.
Env Optional CHANJING_API_BASE, CHANJING_CONFIG_DIR.
User-supplied URL Create Voice API takes a public URL to reference audio; the user is responsible for that URL’s safety and legality; Chanjing’s servers retrieve it.
Network / browser HTTPS to https://open-api.chanjing.cc; may open login when credentials are missing.
Downloads Generated audio is downloaded from URLs returned by the API—trust the API host.
Persistence Default always: false; does not modify other skills.

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

Get Access Token API

从 ~/.chanjing/credentials.json 读取 app_id 和 secret_key,若无有效 Token 则调用:

POST /open/v1/access_token
Content-Type: application/json

请求体(使用本地配置的 app_id、secret_key):

{
  "app_id": "<从 credentials.json 读取>",
  "secret_key": "<从 credentials.json 读取>"
}

Response example:

{
  "trace_id": "8ff3fcd57b33566048ef28568c6cee96",
  "code": 0,
  "msg": "success",
  "data": {
    "access_token": "1208CuZcV1Vlzj8MxqbO0kd1Wcl4yxwoHl6pYIzvAGoP3DpwmCCa73zmgR5NCrNu",
    "expire_in": 1721289220
  }
}

Response field description:

First-level Field Second-level Field Description
code Response status code
msg Response message
data Response data
access_token Valid for one day, previous token will be invalidated
expire_in Token expiration time

Response status code description:

code Description
0 Success
400 Parameter format error
40000 Parameter error
50000 System internal error

Create Voice API

Post to the following endpoint to create a voice.

POST /open/v1/create_customised_audio
access_token: {{access_token}}
Content-Type: application/json

Request body example:

{
  "name": "example",
  "url": "https://example.com/abc.mp3"
}

Request field description:

Field Type Required Description
name string Yes A name for this voice
url string Yes url 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_type string Yes Use "Cicada3.0-turbo"
language string No Either "cn" or "en", default to "cn"

Response example:

{
  "trace_id": "2f0f50951d0bae0a3be3569097305424",
  "code": 0,
  "msg": "success",
  "data": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc"
}

Response field description:

Field Description
code Status Code
msg Message
data Voice ID, to be used in following steps

Response status code description:

Code Description
0 Success
400 Parameter Format Error
10400 AccessToken Error
40000 Parameter Error
40001 QPS Exceeded
50000 Internal System Error

Poll Voice 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.

GET /open/v1/customised_audio?id={{voice_id}}
access_token: {{access_token}}

Response example:

{
  "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 Field Second-level Field Description
code Status Code
msg Response Message
data
id Voice ID
progress Progress: range 0-100
type
name
err_msg Error Message
audio_path
status 0-queued; 1-in progress; 2-done; 3-expired; 4-failed; 99-deleted

Response status code description:

Code Description
0 Success
10400 AccessToken Error
40000 Parameter Error
40001 QPS Exceeded
50000 Internal System Error

Create Speech Generation Task API

Post to the following endpoint to submit a speech generation task:

POST /open/v1/create_audio_task
access_token: {{access_token}}
Content-Type: application/json

Request body example:

{
  "audio_man": "C-Audio-53e4e53ba1bc40de91ffaa74f20470fc",
  "speed": 1,
  "pitch": 1,
  "text": {
    "text": "Hello, I am your AI assistant."
  }
}

Request field description:

Parameter Name Type Nested Key Required Example Description
audio_man string Yes C-Audio-53e4e53ba1bc40de91ffaa74f20470fc Voice ID, obtained from previous step
speed number Yes 1 Speech rate, range: 0.5 (slow) to 2 (fast)
pitch number Yes 1 Pitch (always set to 1)
text object text Yes Hello, I am your Cicada digital human Rich text, text length limit less than 4,000 characters
aigc_watermark bool No false Whether to add visible watermark to audio, default is false

Response field description:

Field Description
code Response status code
msg Response message
task_id Speech synthesis task ID

Example Response

{
  "trace_id": "dd09f123a25b43cf2119a2449daea6de",
  "code": 0,
  "msg": "success",
  "data": {
    "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
  }
}

Response status code description:

code Description
0 Success
400 Incoming parameter format error
10400 AccessToken verification failed
40000 Parameter error
40001 Exceeds QPS limit
40002 Production duration reached limit
50000 System internal error

Query Speech Generation Task Status API

Post a request to the following endpoint:

POST /open/v1/audio_task_state
access_token: {{access_token}}
Content-Type: application/json

Request body example:

{
  "task_id": "88f635dd9b8e4a898abb9d4679e0edc8"
}

Request field description:

Parameter Name Type Required Example Description
task_id string Yes 88f789dd9b8e4a121abb9d4679e0edc8 Task ID obtained in previous step

Response body example:

{
  "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 Field Second-level Field Third-level Field Description
code Response status code
msg Response message
data id Audio ID
type Speech type
status Status: 1 - in progress, 9 - done
text Speech text
full url url to download generated audio file
path
duration Audio duration
slice
errMsg Error message
errReason Error reason
subtitles(array type) key Subtitle ID
start_time Subtitle start time point
end_time Subtitle end time point
subtitle Subtitle text

Response field description:

Code Description
0 Response successful
10400 AccessToken verification failed
40000 Parameter error
50000 System internal error

Scripts

本 Skill 提供脚本(skills/chanjing-tts-voice-clone/scripts/),与 chanjing-credentials-guard 使用同一配置文件;无 AK/SK 时会执行 open_login_page.py 脚本打开注册/登录页。

脚本 说明
create_voice.py 提交定制声音任务(参考音频 URL),输出 voice_id
poll_voice.py 轮询定制声音直到就绪(status=2),输出 voice_id
create_task.py 使用定制声音创建 TTS 任务,输出 task_id
poll_task.py 轮询 TTS 任务直到完成,输出音频下载 URL

示例(在项目根或 skill 目录下执行):

# 1. 创建定制声音(参考音频需为公开 URL)
VOICE_ID=$(python skills/chanjing-tts-voice-clone/scripts/create_voice.py --name "我的声音" --url "https://example.com/ref.mp3")

# 2. 轮询直到声音就绪
python skills/chanjing-tts-voice-clone/scripts/poll_voice.py --voice-id "$VOICE_ID"

# 3. 创建 TTS 任务
TASK_ID=$(python skills/chanjing-tts-voice-clone/scripts/create_task.py --audio-man "$VOICE_ID" --text "Hello, I am your AI assistant.")

# 4. 轮询到完成,得到音频下载链接
python skills/chanjing-tts-voice-clone/scripts/poll_task.py --task-id "$TASK_ID"

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,037
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,015
Skill 文件
  • SKILL.md
    • Chanjing TTS Voice Clone
    • 功能说明
    • 运行依赖
    • 环境变量
    • 使用命令
    • 登记摘要(英文 · ClawHub / OpenClaw)
    • When to Use This Skill
    • How to Use This Skill
      • Reviewer Q&A (four items)
      • Security & credentials (registry summary)
      • Get Access Token API
      • Create Voice API
      • Poll Voice API
      • Create Speech Generation Task API
        • Query Speech Generation Task Status API
    • Scripts
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期