← 返回
效率工具

Chinese TTS

Generate Chinese TTS audio and send as Feishu voice message. Use when user asks for voice/audio/语音/播报/朗读 in Chinese, or when sending audio messages via Feishu.
Generate Chinese TTS audio and send as Feishu voice message. Use when user asks for voice/audio/语音/播报/朗读 in Chinese, or when sending audio messages via Feishu.
waao666
效率工具 clawhub v1.0.0 1 版本 99868.2 Key: 无需
★ 0
Stars
📥 758
下载
💾 12
安装
1
版本
#latest

概述

Chinese TTS Voice Generation

Generate natural Chinese speech using Microsoft Edge TTS and send as Feishu voice messages.

Quick Reference

# 1. Generate MP3
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 /home/clawpi/.local/bin/edge-tts \
  --voice zh-CN-YunxiNeural \
  --text "你的文本内容" \
  --write-media /tmp/output.mp3

# 2. Convert to Opus
ffmpeg -i /tmp/output.mp3 -c:a libopus -b:a 64k -ar 48000 \
  /home/node/.openclaw/workspace/output.opus -y

# 3. Send via Feishu
message(asVoice=true, contentType="audio/ogg",
        filePath="/home/node/.openclaw/workspace/output.opus",
        filename="output.opus")

Critical Rules

  1. Always set UTF-8 env vars — System locale is ISO-8859-1, Chinese text will be corrupted without LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
  2. Must use opus format — Feishu only treats .opus as voice messages; MP3/WAV become file attachments
  3. Must send from workspace/tmp is not in Feishu's mediaLocalRoots whitelist; files there fail silently and fall back to plain text
  4. Use ASCII filenames — Chinese filenames may cause encoding issues in multipart uploads

Voice Options

VoiceGenderStyle
---------
zh-CN-YunxiNeuralMaleNatural, warm (recommended)
zh-CN-XiaoxiaoNeuralFemaleNatural, friendly
zh-CN-YunjianNeuralMaleAuthoritative

For Long Text

Write text to a file and use -f flag:

echo "长文本内容..." > /tmp/text.txt
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 /home/clawpi/.local/bin/edge-tts \
  --voice zh-CN-YunxiNeural -f /tmp/text.txt --write-media /tmp/output.mp3

Troubleshooting

  • Gibberish audio → Missing UTF-8 env vars
  • File sent as attachment, not voice → Not opus format, or not from workspace path
  • Upload fails silently → File not in mediaLocalRoots (use workspace dir)
  • "哈米" instead of "虾米" → Google TTS (gtts) issue; use edge-tts instead

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 06:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,920
productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 446 📥 226,404
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 147,953