feishu-voice飞书语音消息发送技能。将文本转换为语音并发送到飞书,支持 TTS 生成、格式转换、时长读取、文件上传和消息发送。
Install via ClawdBot CLI:
clawdbot install franklu0819-lang/feishu-voice将文本转换为语音消息发送到飞书,支持在飞书聊天窗口直接播放。
# 飞书配置
export FEISHU_APP_ID="cli_xxx" # 飞书应用 ID
export FEISHU_APP_SECRET="your_secret" # 飞书应用密钥
export FEISHU_RECEIVER="ou_xxx" # 接收者 Open ID(可选,默认从上下文获取)
# 智谱 AI 配置(用于 TTS)
export ZHIPU_API_KEY="your_zhipu_key" # 智谱 API 密钥
ffmpeg - 音频格式转换ffprobe - 读取音频信息jq - JSON 处理zhipu-tts - 文字转语音# 发送语音消息
bash scripts/send_voice.sh "你好,这是一条语音消息"
# 指定声音和语速
bash scripts/send_voice.sh "你好" tongtong 1.2
# 可用声音:
# - tongtong (彤彤) - 默认女声,平衡音色
# - chuichui (锤锤) - 男声,深沉音色
# - xiaochen (小陈) - 年轻声音
# 语速范围:0.5 - 2.0(默认 1.0)
主脚本,完整的语音消息发送流程。
用法:
bash scripts/send_voice.sh <文本> [声音] [语速]
参数:
文本 (必需): 要转换为语音的文字声音 (可选): tongtong, chuichui, xiaochen(默认:tongtong)语速 (可选): 0.5-2.0(默认:1.0)环境变量:
FEISHU_APP_ID: 飞书应用 IDFEISHU_APP_SECRET: 飞书应用密钥FEISHU_RECEIVER: 接收者 Open ID(可选)file_type=opus 和 durationmsg_type=audio 消息飞书语音消息要求:
关键: 必须在上传时提供 duration 参数(整数秒),否则时长显示为 0。
# 正确的上传方式
curl -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
-F "file=@voice.opus" \
-F "file_type=opus" \
-F "duration=6" # ← 关键参数
| 端点 | 用途 |
|------|------|
| /auth/v3/tenant_access_token/internal | 获取访问令牌 |
| /im/v1/files | 上传文件 |
| /im/v1/messages | 发送消息 |
问题: 发送的语音消息时长显示为 0
解决: 确保在上传时传递了 duration 参数(整数秒)
# 获取时长(四舍五入)
DURATION=$(ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 voice.opus | awk '{printf "%.0f", $1}')
# 上传时带上 duration
curl ... -F "duration=$DURATION"
问题: 语音消息无法播放
可能原因:
file_type 参数错误解决:
# 检查格式
ffprobe voice.opus
# 重新转换
ffmpeg -i input.wav -c:a libopus -b:a 24k voice.opus
问题: 上传时返回权限错误
解决: 确保飞书应用有以下权限:
im:messageim:message:send_as_bot# 设置环境变量
export FEISHU_APP_ID="your_app_id_here"
export FEISHU_APP_SECRET="your_app_secret_here"
export ZHIPU_API_KEY="your_zhipu_key_here"
# 发送语音
bash /root/.openclaw/workspace/skills/feishu-voice/scripts/send_voice.sh \
"你好,这是一条测试语音消息。"
zhipu-tts: 文字转语音zhipu-asr: 语音转文字Generated Mar 1, 2026
Automates sending voice alerts for order confirmations or service updates via Feishu, enhancing customer engagement. Useful in e-commerce or logistics where timely audio notifications improve user experience and reduce missed messages.
Enables companies to broadcast voice messages for urgent announcements or daily briefings within Feishu groups, ensuring clear communication. Ideal for remote teams in tech or consulting industries to convey tone and urgency effectively.
Facilitates sending voice-based lessons or reminders to students or trainees through Feishu, supporting language learning or training programs. Helps educational institutions or corporate training departments provide accessible audio materials.
Sends personalized voice reminders for medical appointments or medication schedules via Feishu, improving patient compliance. Suitable for clinics or telehealth services to offer friendly, audible notifications that reduce no-shows.
Distributes voice updates about schedule changes or instructions to attendees or staff during conferences or events using Feishu. Beneficial for event organizers in hospitality or entertainment to ensure real-time, clear communication.
Offers this skill as part of a subscription-based platform for businesses to automate voice messaging, with tiered pricing based on usage volume. Revenue is generated through monthly or annual fees, targeting SMEs needing efficient communication tools.
Provides custom integration services for enterprises to embed this skill into their existing Feishu workflows, charging for development and maintenance. Revenue comes from one-time setup fees and ongoing support contracts, focusing on large organizations.
Monetizes the skill by charging per voice message sent, with pricing based on message length or recipient count. Revenue is driven by transaction fees, appealing to users with sporadic or high-volume messaging needs in various industries.
💬 Integration Tip
Ensure all required binaries and environment variables are set up correctly, and test the audio format conversion to avoid playback issues in Feishu.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Read and send email via IMAP/SMTP. Check for new/unread messages, fetch content, search mailboxes, mark as read/unread, and send emails with attachments. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.
Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Automatically logs into email accounts (Gmail, Outlook, QQ Mail, etc.) and generates daily email summaries. Use when the user wants to get a summary of their emails, check important messages, or create daily email digests.
Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. Automatically resolves Wiki URLs to real entities and converts content to Markdown.
Manage Feishu (Lark) calendars by listing, searching, checking schedules, syncing events, and marking tasks with automated date extraction.