跳到正文
cccskills
免费在 GitHub 公开

byted-text-to-speech

将文本合成为语音(TTS)。使用火山引擎豆包语音合成 API,支持流式合成、多种音色、语速/音调/音量调节、Markdown 过滤和 LaTeX 公式播报。当用户需要把文字转成语音、生成朗读音频、配音、旁白、播报,或提到「文字转语音」「TTS」「语音合成」「朗读」「配音」时使用本技能。

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(7)

  • SKILL.md4.2 KB
  • LICENSE11.1 KB
  • references/docs-index.md3.1 KB
  • references/setup-guide.md1.9 KB
  • requirements.txt108 B
  • scripts/api_key.py4.4 KB
  • scripts/text_to_speech.py9.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Byted-Text-to-Speech Skill

基于火山引擎豆包语音合成(HTTP Chunked/SSE 单向流式-V3)将文本转为语音并保存为音频文件。

何时使用

当用户有以下需求时,优先使用本 skill:

  • 需要把一段文字转成语音、朗读音频
  • 需要生成配音、旁白、播报、有声读物片段
  • 需要将代码注释、文档、文章等内容转为音频便于收听
  • 需要生成多语言语音(中文、英文等)
  • 用户提到「文字转语音」「TTS」「语音合成」「朗读」「配音」「念出来」「读给我听」
  • 用户没有明确说"语音合成",但任务本质上需要将文本内容转为可播放的音频时

使用前检查

优先检查是否已配置以下凭证:

  • MODEL_SPEECH_API_KEY

如果缺少凭证,打开 references/setup-guide.md 查看开通、申请和配置方式,并给予用户开通建议

脚本参数

参数简写必填说明
--text-t是要合成的文本内容
--output-o否输出音频文件路径(默认自动生成)
--speaker-s否发音人,默认 zh_female_vv_uranus_bigtts,音色列表
--format否音频格式:mp3(默认)、pcm、ogg_opus
--sample-rate否采样率,如 16000、24000(默认 24000)
--speech-rate否语速 [-50, 100],100 代表 2.0 倍速,-50 代表 0.5 倍速,默认 0
--pitch-rate否音调 [-12, 12],默认 0
--loudness-rate否音量 [-50, 100],100 代表 2.0 倍音量,-50 代表 0.5 倍音量,默认 0
--bit-rate否比特率,对 mp3 和 ogg_opus 格式生效(如 64000、128000),默认 64000
--filter-markdown否过滤 markdown 语法(如 **你好** 读为"你好"),默认关闭
--enable-latex否启用 LaTeX 公式播报(使用 latex_parser v2,自动开启 markdown 过滤),默认关闭

返回值说明

脚本输出 JSON,包含:

  • status: "success" 或 "error"
  • local_path: 本地音频文件路径
  • format: 音频格式
  • error: 失败时的错误信息

请将 local_path 或可访问的音频 URL 返回给用户,便于播放或下载。

错误处理

  • 若报错 PermissionError: MODEL_SPEECH_API_KEY ... 需在环境变量中配置:提示用户在 API Key 管理 获取并配置 MODEL_SPEECH_API_KEY,写入 workspace 下的环境变量文件后重试。
  • 若返回 4xx/5xx 或业务错误码:根据错误信息提示用户检查文本内容、发音人 ID 及账号是否已开通豆包语音服务。

故障排查

  • 缺少凭证:打开 references/setup-guide.md
  • 需要查 API 参数、字段、错误码:打开 references/docs-index.md
  • 如果脚本返回权限错误,优先检查服务是否已开通、凭证是否有效,给予用户明确的操作指引

参考资料

按需打开以下文件,不必默认全部加载:

  • references/setup-guide.md:服务开通、凭证申请、环境变量配置
  • references/docs-index.md:API 文档索引、参数说明、音色列表、错误码速查

示例

# 基本用法
python scripts/text_to_speech.py -t "欢迎使用火山引擎语音合成服务。"

# 指定发音人与输出格式
python scripts/text_to_speech.py -t "这是一段测试语音。" -s zh_female_vv_uranus_bigtts -o output.mp3 --format mp3

# 指定语速与采样率
python scripts/text_to_speech.py -t "语速和音调可调。" --speech-rate 10 --sample-rate 16000

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Deploy, update, validate, and troubleshoot the AgentKit hybrid-cloud customer-service demo in this directory. Use when a user asks an AI coding agent to follow the README, deploy or update the demo, configure OpenAPI/Runtime/Knowledge/Memory/Sandbox/MCP/Skills/A2A, run customer-view validation, or record manual platform steps and failures.

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

Generate deterministic SVG algorithmic artwork. Invoke when the user asks for geometric, generative, or algorithmic visual art.

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

通过本地 Python CLI 和 OpenAPI 客户端管理、排查火山云手机资源。适用于查询实例和资源、截图、执行命令、查看任务、检查应用、主机和机房容量、标签、DNS、路由,以及操作已授权的测试云手机实例。

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

Launch and continue the Volcengine AI Research survey workflow for concept testing, audience design, questionnaire drafting, interview guide generation, execution confirmation, progress checks, and result queries. Use this skill when the user wants to create, revise, confirm, execute, or follow up on a real AI research survey task in ABCompass instead of doing generic brainstorming, copywriting, translation, summarization, or broad market discussion.

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

Create and check long-running video material evaluation tasks. Use this skill when the user wants to submit videos for evaluation, check an existing video evaluation task list, or fetch the result of a previously created video evaluation task. This skill is not a general-purpose video upload skill because upload is allowed only as an internal step of task creation. Authentication uses an API key passed as an Authorization bearer token.

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

火山引擎 AntiDDoSPro 高防域名只读巡检。用户要查域名健康、攻击、流量、CC/WAF/区域封禁、智能防护或 CCAI 状态时使用。

中文简介正在准备中。当前显示原文说明。

bytedance/agentkit-samples4732026年10月22日 更新

查看 bytedance 的全部技能

报告此技能的问题