voice2feishu

文字转语音并发送到飞书。支持两种模式:API 模式(智谱/OpenAI 等)和本地模式(ChatTTS)。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "voice2feishu" with this command: npx skills add voice2feishu

Voice2Feishu - 语音发送到飞书

文字 → 语音 → 飞书。两种模式任选。

快速开始

1. 配置环境变量

# 飞书配置(必需)
export FEISHU_APP_ID="cli_xxx"
export FEISHU_APP_SECRET="your_secret"

# 语音 API 配置(API 模式需要)
export TTS_API_KEY="your_api_key"
export TTS_API_URL="https://open.bigmodel.cn/api/paas/v4/audio/speech"  # 智谱
# 或
export TTS_API_URL="https://api.openai.com/v1/audio/speech"  # OpenAI

2. 发送语音

API 模式(推荐)

voice2feishu api "你好,这是一条测试消息" ou_example1234567890abcdef

本地 ChatTTS 模式

# 先启动 ChatTTS 服务
voice2feishu start-chattts

# 发送语音
voice2feishu local "你好,这是本地语音" ou_example1234567890abcdef

使用方式

voice2feishu <模式> <文字内容> <接收者ID> [选项]

模式

模式说明依赖
api使用第三方 API 生成语音TTS_API_KEY, TTS_API_URL
local使用本地 ChatTTSChatTTS 服务
start-chattts启动本地 ChatTTS 服务Python, ChatTTS
stop-chattts停止 ChatTTS 服务-

参数

  • 文字内容:要转换为语音的文字
  • 接收者ID:飞书用户 open_id 或群聊 chat_id
  • 选项
    • --voice <名称>:指定音色(API 模式)
    • --seed <数字>:指定随机种子(本地模式,默认 500)
    • --chat:接收者是群聊(使用 chat_id 类型)

示例

# API 模式 - 发给个人
voice2feishu api "会议提醒:下午3点产品评审" ou_example1234567890abcdef

# API 模式 - 发到群聊
voice2feishu api "大家好,今天有新消息" oc_example1234567890abcdef --chat

# 本地模式 - 指定音色种子
voice2feishu local "这是另一种声音" ou_example1234567890abcdef --seed 100

# 启动/停止 ChatTTS
voice2feishu start-chattts
voice2feishu stop-chattts

两种模式对比

特性API 模式本地模式
音质
速度
成本按 API 调用收费免费(需 GPU 更佳)
隐私文字发送到第三方完全本地处理
音色取决于 API可调 seed 随机生成
依赖API KeyChatTTS + Python

支持的 TTS API

智谱 GLM-4-Voice(推荐)

export TTS_API_URL="https://open.bigmodel.cn/api/paas/v4/audio/speech"
export TTS_API_KEY="your_zhipu_api_key"

支持音色:alloy, echo, fable, onyx, nova, shimmer

OpenAI TTS

export TTS_API_URL="https://api.openai.com/v1/audio/speech"
export TTS_API_KEY="your_openai_api_key"

支持音色:alloy, echo, fable, onyx, nova, shimmer

其他兼容 API

只要 API 格式兼容 OpenAI TTS(POST JSON,返回 audio/mpeg),都可以使用。

本地 ChatTTS 配置

安装 ChatTTS

# 方式 1:pip 安装
pip install ChatTTS

# 方式 2:克隆源码
git clone https://github.com/2noise/ChatTTS.git
cd ChatTTS
pip install -e .

模型下载

ChatTTS 首次运行时会自动下载模型(约 2GB)。如果自动下载失败,可手动下载:

模型地址

手动下载步骤

# 方式 1:使用 huggingface-cli
pip install huggingface_hub
huggingface-cli download 2Noise/ChatTTS --local-dir ~/.cache/huggingface/hub/models--2Noise--ChatTTS

# 方式 2:使用 modelscope(国内更快)
pip install modelscope
python -c "from modelscope import snapshot_download; snapshot_download('pkuchoong/ChatTTS', cache_dir='~/.cache/modelscope')"

模型缓存位置

  • Hugging Face: ~/.cache/huggingface/hub/
  • ModelScope: ~/.cache/modelscope/

常见下载问题

问题解决方案
网络超时使用 ModelScope 镜像
磁盘空间不足清理缓存,确保有 3GB+ 空间
权限错误检查缓存目录权限
下载中断删除部分下载的文件,重新下载

启动服务

voice2feishu start-chattts

服务启动后监听 http://localhost:8080

设置默认音色

ChatTTS 通过 seed 控制音色。建议测试几个 seed,选一个喜欢的:

# 测试不同 seed
voice2feishu local "测试音色" ou_xxx --seed 100
voice2feishu local "测试音色" ou_xxx --seed 500
voice2feishu local "测试音色" ou_xxx --seed 1000

找到喜欢的 seed 后,设置环境变量:

export CHATTTS_DEFAULT_SEED=500

环境变量完整列表

# 飞书(必需)
FEISHU_APP_ID="cli_xxx"
FEISHU_APP_SECRET="xxx"

# API 模式
TTS_API_URL="https://open.bigmodel.cn/api/paas/v4/audio/speech"
TTS_API_KEY="xxx"
TTS_DEFAULT_VOICE="alloy"

# 本地模式
CHATTTS_URL="http://localhost:8080"
CHATTTS_DEFAULT_SEED=500

故障排查

"获取 token 失败"

  • 检查 FEISHU_APP_ID 和 FEISHU_APP_SECRET 是否正确
  • 确认飞书应用已启用并添加了消息权限

"ChatTTS 服务未启动"

voice2feishu start-chattts

"API 调用失败"

  • 检查 TTS_API_KEY 是否有效
  • 检查 TTS_API_URL 是否正确
  • 确认 API 账户有余额

文件结构

voice2feishu/
├── SKILL.md              # 本文档
├── scripts/
│   ├── voice2feishu.sh   # 主入口
│   ├── api-tts.sh        # API TTS 逻辑
│   ├── local-tts.sh      # 本地 ChatTTS 逻辑
│   └── upload-feishu.sh  # 飞书上传逻辑

致谢


created 2026-03-24

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Feishu Voice Loop

Accept text or voice input, transcribe if needed, generate natural OpenAI TTS speech, and send audio output to Feishu chat or web player.

Registry SourceRecently Updated
3740Profile unavailable
General

Lark (Feishu) Voice

Send voice messages on Lark (Feishu) by converting text to speech. Use when the user asks to send a voice message or reply with voice.

Registry SourceRecently Updated
2711Profile unavailable
General

Feishu Voice

飞书语音消息发送技能。将文本转换为语音并发送到飞书,支持 TTS 生成、格式转换、语速调整、时长读取、文件上传和消息发送。

Registry Source
1.5K1Profile unavailable
General

语音交互技能-feishu&qq-byLi

飞书语音交互技能。支持语音消息自动识别、AI 处理、语音回复全流程。需要配置 FEISHU_APP_ID 和 FEISHU_APP_SECRET 环境变量。使用 faster-whisper 进行语音识别,Edge TTS 进行语音合成,自动转换 OPUS 格式并通过飞书发送。适用于飞书平台的语音对话场景。

Registry Source
1820Profile unavailable