Install
openclaw skills install feishu-speaker飞书双向语音消息工具 - 支持语音转文字接收和文字转语音发送(TTS+Whisper)
openclaw skills install feishu-speaker飞书双向语音消息工具 - 让AI助手像真人一样语音交流
✅ 支持双向:接收语音(转文字)+ 发送语音(TTS)
✅ 智能回复:根据接收消息类型自动选择回复方式
# 1. 安装Whisper(语音转文字)
pip install openai-whisper
# 2. 安装Edge-TTS(文字转语音)
npm install -g edge-tts
# 3. 安装FFmpeg(音频格式转换)
# macOS: brew install ffmpeg
# Ubuntu: apt-get install ffmpeg
创建文件 ~/.openclaw/.credentials/feishu-app-secret.txt:
你的飞书App Secret
获取方式:
# 转录收到的语音消息
feishu-speaker listen voice.ogg
# 使用更大的模型(更准确但更慢)
feishu-speaker listen voice.ogg --model small
# 基本使用
feishu-speaker say "你好,这是语音消息"
# 指定音色
feishu-speaker say "晚上好" --voice zh-CN-YunxiNeural
# 调整语速
feishu-speaker say "加快速度" --rate "+30%"
# 根据收到的消息类型自动选择回复方式
feishu-speaker reply "收到,我马上处理"
| 音色ID | 性别 | 风格 | 推荐场景 |
|---|---|---|---|
zh-CN-YunxiNeural | 男 | 年轻、干脆利落 ⭐ | 日常交流、快速回复 |
zh-CN-YunjianNeural | 男 | 成熟稳重 | 正式场合、商务沟通 |
zh-CN-XiaoxiaoNeural | 女 | 标准女声 | 温和回复、客服场景 |
zh-CN-XiaoyiNeural | 女 | 温柔女声 | 亲切交流、情感场景 |
feishu-speaker listen - 语音转文字feishu-speaker listen <音频文件> [选项]
选项:
-m, --model <模型> Whisper模型(tiny/base/small,默认:base)
-l, --language <语言> 指定语言(默认:zh)
-o, --output <文件> 输出到文件
示例:
feishu-speaker listen message.ogg
feishu-speaker listen voice.mp3 --model small
feishu-speaker say - 文字转语音并发送feishu-speaker say <文字内容> [选项]
选项:
-v, --voice <音色> 指定音色(默认:zh-CN-YunxiNeural)
-r, --rate <速率> 语速调整(默认:+20%)
-t, --to <用户ID> 指定接收者
-s, --save <文件> 保存音频文件(不发送)
示例:
feishu-speaker say "你好"
feishu-speaker say "会议开始" --voice zh-CN-YunjianNeural
feishu-speaker say "快速播报" --rate "+50%"
feishu-speaker reply - 智能回复feishu-speaker reply <文字内容> [选项]
选项:
--voice 强制语音回复
--text 强制文字回复
--auto 根据对方消息类型自动选择(默认)
示例:
feishu-speaker reply "收到"
feishu-speaker reply "好的" --voice
配置文件:~/.openclaw/skills/feishu-speaker/config/config.json
{
"default_voice": "zh-CN-YunxiNeural",
"default_rate": "+20%",
"default_volume": "+0%",
"default_pitch": "default",
"reply_mode": "auto",
"app_id": "cli_a9037acd2ba19bb5",
"receiver_id": "ou_94f3936f1896b5378404f377da3fae6f"
}
配置说明:
default_voice: 默认TTS音色default_rate: 默认语速(+20% = 1.2倍速)reply_mode: 回复模式
auto: 自动匹配(语音→语音,文字→文字)voice: 总是语音回复text: 总是文字回复# 用户发送语音 → AI转录理解 → 语音回复
# 自动流程:
# 1. 用户:发送语音"帮我查一下明天的天气"
# 2. AI:feishu-speaker listen voice.ogg → 转录为文字
# 3. AI:处理请求 → feishu-speaker reply "明天北京晴天,25度"
# 在cron任务中使用
feishu-speaker say "早上好!今日热点已更新,请查看。"
# 正式场合
feishu-speaker say "会议将在10分钟后开始。" --voice zh-CN-YunjianNeural
# 活泼场合
feishu-speaker say "好消息!任务提前完成了!" --voice zh-CN-YunxiNeural --rate "+30%"
接收语音流程:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ 飞书语音消息 │ ──→ │ Whisper │ ──→ │ 文字结果 │
│ (ogg格式) │ │ (本地转录) │ │ (中文文本) │
└─────────────┘ └─────────────┘ └─────────────┘
发送语音流程:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ 文字输入 │ ──→ │ Edge-TTS │ ──→ │ FFmpeg │ ──→ │ 飞书API │
│ (中文文本) │ │ (生成MP3) │ │ (转opus/ogg)│ │ (发送语音) │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
# 手动下载模型
python3 -c "import whisper; whisper.load_model('base')"
ou_ 开头)# 使用npx直接运行
npx edge-tts "测试" --voice zh-CN-YunxiNeural --write-media output.mp3
| 功能 | feishu-voice | feishu-speaker (本skill) |
|---|---|---|
| 发送语音 | ✅ | ✅ |
| 接收语音(转文字) | ❌ | ✅ |
| 双向交互 | ❌ | ✅ |
| 智能回复模式 | ❌ | ✅ |
| 多音色支持 | ✅ | ✅ |
| 语速调节 | ✅ | ✅ |
MIT License
让飞书沟通更自然,像真人一样语音交流! 🎙️✨
reply-voice 脚本(v1.1.0新增)功能:自动处理完整的语音消息回复流程
用法:
# 转录语音并发送回复
reply-voice voice.ogg "这是回复内容"
# 仅转录,不发送
reply-voice voice.ogg
完整流程:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ 飞书语音消息 │ → │ Whisper │ → │ Edge-TTS │ → │ 飞书API │
│ (ogg格式) │ │ 转录文字 │ │ 生成语音 │ │ 发送语音 │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
依赖: