Generate Feishu voice messages that play directly in chat (with waveform display) on both mobile and desktop.
生成飞书语音消息,手机和电脑端都能在聊天中直接播放(带波形图显示)。
Feishu voice messages require OPUS format, not MP3!
飞书语音消息需要 OPUS 格式,不是 MP3!
Format 格式Display 显示Desktop 电脑端.opusVoice message (waveform) 语音消息(波形图)✅ Click to play 点击播放.mp3Regular file 普通文件Need download 需下载播放
Preset 预设Voice 音色Pitch 音调Rate 语速Use Case 适用场景manboXiaoyiNeural+50HzdefaultLively, energetic 活泼有活力xiaoyiXiaoyiNeuraldefault+30%Fast-paced, news 快节奏xiaoxiaoXiaoxiaoNeuraldefaultdefaultNatural, general 自然通用yunyangYunyangNeuraldefault+10%Narration, documentary 旁白纪录片
Preset 预设Voice 音色Pitch 音调Rate 语速Use Case 适用场景xiaotangdouXiaoyiNeural+15%-5%Lively, animation, stories 活泼童趣mianhuatangXiaoxiaoNeural+5%-10%Gentle, bedtime stories 温柔故事xiaomengmengXiaoxiaoNeural+10%-5%Friendly, educational 亲切教育
bash
# Basic usage / 基本用法
python scripts/feishu_voice.py "Your text here" --preset manbo
# Kids voice / 儿童音色
python scripts/feishu_voice.py "儿童故事内容" --preset xiaotangdou
text
# Just ask the agent to generate voice message
# 直接让代理生成语音消息
User: 帮我生成一个语音消息:"你好,欢迎使用飞书!" 用小糖豆音色
Agent: [Generates and sends .opus file]
Edge TTS - Node.js package for text-to-speech bash
npm install edge-tts
FFmpeg - For MP3 to OPUS conversion bash
# Windows: Download from https://ffmpeg.org
# Mac: brew install ffmpeg
# Linux: sudo apt install ffmpeg
text
Text → Edge TTS → MP3 → FFmpeg → OPUS → Feishu Voice Message
bash
ffmpeg -i input.mp3 -c:a libopus -b:a 64k output.opus
When sending to Feishu, use correct MIME type:
javascript
// Voice message (clickable on desktop)
message({ action: "send", path: "audio.opus", mimeType: "audio/opus" })
// Regular file (download required on desktop)
message({ action: "send", path: "audio.mp3", mimeType: "audio/mpeg" })
Created by / 创建者: systiger
Version / 版本: 1.0.0