Multi Edge-TTS CN

v2.2.0

Edge-TTS 在线语音合成 skill。基于微软 Edge TTS 引擎,生成速度快(1-2秒),支持多种音色和输出格式。同时支持飞书(OGG/Opus)和企业微信(AMR)。默认音色 xiaoxiao_lively。需联网。

0· 51·0 current·0 all-time
byitian@itian932

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for itian932/multi-edge-tts-cn.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Multi Edge-TTS CN" (itian932/multi-edge-tts-cn) from ClawHub.
Skill page: https://clawhub.ai/itian932/multi-edge-tts-cn
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install multi-edge-tts-cn

ClawHub CLI

Package manager switcher

npx clawhub@latest install multi-edge-tts-cn
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the implementation: engine.py + voices.json implement TTS via edge-tts and ffmpeg, with format conversion and platform-specific output choices. No unrelated capabilities or environment variables are requested.
Instruction Scope
SKILL.md and engine.py stick to TTS responsibilities: load voice config, call edge-tts to synthesize MP3, convert with ffmpeg, and return a local path. The instructions reference only local files and the agent's message.send(filePath=...) mechanism (appropriate for sending local files). There are no instructions to read unrelated system files or to transmit arbitrary data to unknown endpoints.
Install Mechanism
There is no registry install spec, but scripts/install.sh is provided. It installs edge-tts via pip (PyPI) and requires ffmpeg to be present (or instructs apt install). Installing Python packages via pip is expected for this skill but will modify the environment (may install globally unless used inside a virtualenv). No downloads from untrusted URLs or archive extraction were observed.
Credentials
The skill declares no required environment variables or credentials and the code does not access secrets or unrelated env vars. The only network activity is the expected edge-tts client contacting Microsoft's TTS endpoints (implicit in the edge-tts library).
Persistence & Privilege
always:false and no changes to other skills or agent configs. The install script changes the Python environment by installing a package (normal for this type of skill) but the skill does not request persistent elevated privileges or modify other skills' settings.
Assessment
This skill appears to do what it claims (local wrapper for edge-tts + ffmpeg). Before installing: (1) be aware edge-tts makes network calls to Microsoft services to synthesize audio—don't send sensitive secrets as input; (2) run the install script inside a Python virtualenv if you want to avoid global pip installs; (3) ffmpeg must be installed on the host (the script will abort if missing); (4) generated files default to /tmp/openclaw and are accessible to local processes—clean or restrict as needed; (5) inspect or run the included scripts in a sandbox if you have higher security concerns. If you want additional assurance, ask the author for a signed release or run the tool in an isolated container.

Like a lobster shell, security has layers — review code before you run it.

latestvk9774a24g6ssfavfc53adxkwe585q1gq
51downloads
0stars
8versions
Updated 10h ago
v2.2.0
MIT-0

Multi Edge-TTS 语音合成 Skill

概述

  • 引擎: edge-tts 7.2.8
  • 路径: ~/.openclaw/workspace/skills/multi-edge-tts-cn/
  • 入口脚本: scripts/engine.py
  • 音色配置: config/voices.json
  • 速度: 1-2 秒生成
  • 多平台支持: 飞书(OGG/Opus)、企业微信(AMR)

官方音色

来自 Edge-TTS 引擎原始音色,使用默认参数。

zh-CN(普通话)

音色性别音色 ID
zh-CN-XiaoxiaoNeuralxiaoxiao
zh-CN-XiaoyiNeuralxiaoyi
zh-CN-YunjianNeuralyunjian
zh-CN-YunxiNeuralyunxi
zh-CN-YunxiaNeuralyunxia
zh-CN-YunyangNeuralyunyang
zh-CN-liaoning-XiaobeiNeuralliaoning_xiaobei
zh-CN-shaanxi-XiaoniNeuralshaanxi_xiaoni

zh-HK(粤语)

音色性别音色 ID
zh-HK-HiuGaaiNeuralhk_hiuGaai
zh-HK-HiuMaanNeuralhk_hiuMaan
zh-HK-WanLungNeuralhk_wanLung

zh-TW(台湾)

音色性别音色 ID
zh-TW-HsiaoChenNeuraltw_hsiaoChen
zh-TW-HsiaoYuNeuraltw_hsiaoYu
zh-TW-YunJheNeuraltw_yunJhe

自定义音色

基于官方音色调试过 rate/pitch/volume 参数的音色。

音色 ID基础音色参数描述
xiaoxiao_lively(默认)xiaoxiao+8%速 +10Hz +5%音量女声 活泼偏高音
xiaoxiao_gentlexiaoxiao+5%速 +4Hz女声 甜美温柔
xiaoxiao_fastxiaoxiao+15%速 +2Hz +10%音量女声 快速明亮
xiaoxiao_slowxiaoxiao+5%速 -2Hz女声 温柔慢速
xiaoyi_livelyxiaoyi+15%速 +5Hz +10%音量女声 卡通元气
yunxi_sunnyyunxi+15%速 +3Hz +5%音量男声 阳光活泼

调用方式

CLI

# 默认音色(xiaoxiao_lively),默认 .ogg 输出(飞书气泡语音格式)
python3 scripts/engine.py --text "你好呀"

# 指定音色
python3 scripts/engine.py --text "你好呀" --voice xiaoyi

# 企业微信语音消息(AMR 格式)
python3 scripts/engine.py --text "你好呀" --output /tmp/voice.amr

# 指定其他输出格式
python3 scripts/engine.py --text "你好呀" --output /tmp/goodnight.wav

# 列出全部音色
python3 scripts/engine.py --list-voices

Python API & 飞书发送

import sys, os
sys.path.insert(0, os.path.expanduser("~/.openclaw/workspace/skills/multi-edge-tts-cn/scripts"))
from engine import generate

# 1. 生成语音(飞书用 OGG 格式)
code, path = generate("你好呀", voice_id="xiaoxiao_lively", output_path="/tmp/voice.ogg")

# 2. 生成语音(企业微信用 AMR 格式)
code, path = generate("你好呀", voice_id="xiaoxiao_lively", output_path="/tmp/voice.amr")

# 3. 使用 OpenClaw message 工具发送(支持绝对路径,无需上传云空间)
# message.send(filePath=path)

💡 核心提示:在 OpenClaw 环境中,生成语音文件后,直接使用 message.send(filePath="/绝对路径/文件") 即可实现语音消息推送。不需要上传到云空间再发送,这是最高效的用法!

📝 参数对比与推荐:

  • filePath (🏆 强烈推荐):语义最清晰,专为本地文件设计,最稳定。
  • path (✅ 可用):filePath 的简写别名,功能一致。
  • media (⚠️ 慎用):通常用于网络 URL,虽然支持本地绝对路径,但在某些环境下可能触发"Invalid URL"警告。

📱 平台格式对照:

平台推荐格式文件大小限制备注
飞书OGG/Opus10 MB默认格式,音质好
企业微信AMR2 MB气泡语音要求

输出格式

根据 --output 的扩展名自动选择编码器:

扩展名编码器采样率声道备注
.ogg / .opuslibopus48kHzmono飞书推荐,voip 优化,64kbps
.amrlibopencore_amrnb8kHzmono企业微信推荐,12.2kbps
.mp3libmp3lame48kHzmono64kbps
.wavpcm_s16le48kHzmono无损 PCM
.flacflac48kHzmono无损压缩
.aacaac48kHzmono64kbps
未知自动回退 .ogg48kHzmono打印警告

输出路径与存放规范

⚠️ 重要:OpenClaw 媒体发送安全限制

飞书消息发送(message.send(filePath=...))仅允许读取以下"白名单"目录下的文件:

  1. /tmp/openclaw (推荐默认路径)
  2. ~/.openclaw/media
  3. ~/.openclaw/workspace
  4. ~/.openclaw/sandboxes

请使用绝对路径发送文件,无需上传云空间。

默认路径:/tmp/openclaw/edge_{音色ID}_{时间戳}.ogg

飞书发送推荐格式:OGG/Opus 企业微信发送推荐格式:AMR(文件大小需 ≤ 2MB)

文本规范

  • ✅ 使用中文标点(,。!?)
  • ⚠️ 标点决定停顿:句号(。)= 长停顿,逗号(,)= 短停顿
  • ✅ 可包含语气词

技术细节

处理流程

加载音色配置 → 申请速率许可 → Edge-TTS 生成 MP3 → ffmpeg 转目标格式 → 清理临时文件 → 返回路径

引擎特性

  • 速率控制:每秒最多 3 个请求(防 429 限速)
  • 429 重试:指数退避 1s → 2s → 4s,最多 3 次
  • 临时文件:MP3 中间文件生成后自动清理
  • 整段合成:不分段,直接处理完整文本
  • 格式自适应:根据输出扩展名自动选择编码器和参数

依赖

  • Python 3.8+
  • edge-tts 7.2.8
  • ffmpeg

Comments

Loading comments...