Feishu Voice
飞书语音消息发送技能。将文本转换为语音并发送到飞书,支持 TTS 生成、格式转换、语速调整、时长读取、文件上传和消息发送。 Skill: Feishu Voice Owner: franklu0819-lang Summary: 飞书语音消息发送技能。将文本转换为语音并发送到飞书,支持 TTS 生成、格式转换、语速调整、时长读取、文件上传和消息发送。 Tags: audio:1.1.2, chinese:1.1.2, coze:1.1.2, feishu:1.1.2, latest:1.2.0, messaging:1.1.2, tts:1.1.2, voice:1.1.2 Version history: v1.2.0 | 2026-03-28T15:13:35.856Z | user 优化Token获取逻辑,修复参数错误,增加默认配置支持 v1.1.2 | 2026-03-25T04:10:52.367Z | user 删除遗留脚本,修复硬编码路径,测试验证通过 v1.1.1 | 2026-03-25T03:21:56.404Z | user 修
Rank
62
Safety
84
Downloads
2.5k
Updated
Oct 9, 2026
Version
1.2.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 2.5K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 2.5K downloadsadoption · observed Oct 9, 2026
- Latest release
- 1.2.0release · observed Mar 28, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s178vhkrfj7fyecavdqnte98p583hvqc:feishu-voice- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-feishu-voice/snapshot"
Documentation
CLAWHUB
54,014 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: feishu-voice
description: 飞书语音消息发送技能。将文本转换为语音并发送到飞书,支持 TTS 生成、格式转换、语速调整、时长读取、文件上传和消息发送。
metadata: {
"openclaw": {
"requires": {
"bins": ["ffmpeg", "ffprobe", "jq"],
"env": ["FEISHU_APP_ID", "FEISHU_APP_SECRET", "COZE_API_KEY"],
"optional_env": ["FEISHU_RECEIVER", "FEISHU_APP_ID_B", "FEISHU_APP_SECRET_B", "FEISHU_RECEIVER_B", "OPENCLAW_WORKSPACE"],
"skills": ["coze-tts"]
}
}
}
---
# 飞书语音消息发送技能
将文本转换为语音消息发送到飞书,支持在飞书聊天窗口直接播放。
## 功能特性
- ✅ TTS 文字转语音(使用 **coze-tts**)
- ✅ 支持语速调整(0.5-2.0x)
- ✅ 自动转换为 opus 格式(飞书要求)
- ✅ 读取音频时长
- ✅ 上传到飞书服务器
- ✅ 发送可播放的语音消息
## 前置要求
### 环境变量
**必需变量:**
```bash
# 飞书配置(必需)
export FEISHU_APP_ID="cli_xxx" # 飞书应用 ID
export FEISHU_APP_SECRET="your_secret" # 飞书应用密钥
# Coze 配置(用于 TTS)
export COZE_API_KEY="your_coze_key" # Coze API 密钥
```
**可选变量:**
```bash
# 接收者配置
export FEISHU_RECEIVER="ou_xxx" # 默认接收者 Open ID
# 多应用配置(用于支持多个飞书应用)
export FEISHU_APP_ID_B="cli_xxx" # 应用 B 的 ID
export FEISHU_APP_SECRET_B="your_secret" # 应用 B 的密钥
export FEISHU_RECEIVER_B="ou_xxx" # 应用 B 的接收者
# 工作区路径(用于定位依赖技能)
export OPENCLAW_WORKSPACE="/path/to/workspace" # OpenClaw 工作区目录
```
### 必需工具
- `ffmpeg` - 音频格式转换、语速调整
- `ffprobe` - 读取音频信息
- `jq` - JSON 处理
### 依赖技能
- `coze-tts` - 文字转语音
## 使用方法
### 基本用法
```bash
# 发送语音消息
bash scripts/send_voice.sh "你好,这是一条语音消息"
```
### 高级选项
```bash
# 指定 voice_id 和语速
bash scripts/send_voice.sh "你好" 2 1.2
# 参数说明:
# - voice_id: Coze 音色 ID(默认 1)
# - 语速: 0.5-2.0(默认 1.0)
```
## 脚本说明
### send_voice.sh
主脚本,完整的语音消息发送流程。
**用法:**
```bash
bash scripts/send_voice.sh <文本> [voice_id] [语速] [接收者]
```
**参数:**
- `文本` (必需): 要转换为语音的文字
- `voice_id` (可选): Coze 音色 ID(默认:1)
- `语速` (可选): 0.5-2.0(默认:1.0)
- `接收者` (可选): 飞书 open_id
**环境变量:**
- `FEISHU_APP_ID`: 飞书应用 ID
- `FEISHU_APP_SECRET`: 飞书应用密钥
- `FEISHU_RECEIVER`: 接收者 Open ID(可选)
- `COZE_API_KEY`: Coze API 密钥
### 流程说明
1. **TTS 生成**: 使用 coze-tts 生成 MP3 格式音频
2. **语速调整**(可选): 使用 ffmpeg atempo 滤镜调整语速
3. **格式转换**: 使用 ffmpeg 转换为 opus 格式
4. **读取时长**: 使用 ffprobe 获取音频时长(毫秒)
5. **上传文件**: 上传到飞书,指定 `file_type=opus` 和 `duration`
6. **发送消息**: 发送 `msg_type=audio` 消息
## 技术细节
### 音频格式要求
飞书语音消息要求:
- **格式**: opus (OGG 容器)
- **编码**: libopus
- **比特率**: 24k
- **采样率**: 24000 Hz
- **声道**: 单声道
### Duration 参数
**关键**: 必须在上传时提供 `duration` 参数(整数毫秒),否则时长显示为 0。
```bash
# 正确的上传方式
curl -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
-F "[email protected]" \
-F "file_type=opus" \
-F "duration=6000" # ← 关键参数(毫秒)
```
### API 端点
| 端点 | 用途 |
|------|------|
| `/auth/v3/tenant_access_token/internal` | 获取访问令牌 |
| `/im/v1/files` | 上传文件 |
| `/im/v1/messages` | 发送消息 |
## 故障排查
### 语音没有时长
**问题**: 发送的语音消息时长显示为 0
**解决**: 确保在上传时传递了 `duration` 参数(整数毫秒)
```bash
# 获取时长(转换为毫秒)
DURATION_MS=$(ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 voice.opus | awk '{printf "%.0f", $1 * 1000}')
# 上传时带上 duration(毫秒)
curl ... -F "duration=$DURATION_MS"
```
###README.md
# 飞书语音消息发送技能
将文本转换为语音消息并发送到飞书,支持在飞书聊天窗口直接播放。
## 功能特性
- ✅ TTS 文字转语音(使用 **coze-tts**)
- ✅ 支持语速调整(0.5-2.0x)
- ✅ 自动转换为 opus 格式(飞书要求)
- ✅ 读取音频时长
- ✅ 上传到飞书服务器
- ✅ 发送可播放的语音消息
## 前置要求
### 环境变量
**必需变量:**
```bash
# 飞书配置(必需)
export FEISHU_APP_ID="cli_xxx" # 飞书应用 ID
export FEISHU_APP_SECRET="your_secret" # 飞书应用密钥
# Coze 配置(用于 TTS)
export COZE_API_KEY="your_coze_key" # Coze API 密钥
```
**可选变量:**
```bash
# 接收者配置
export FEISHU_RECEIVER="ou_xxx" # 默认接收者 Open ID
# 多应用配置(用于支持多个飞书应用)
export FEISHU_APP_ID_B="cli_xxx" # 应用 B 的 ID
export FEISHU_APP_SECRET_B="your_secret" # 应用 B 的密钥
export FEISHU_RECEIVER_B="ou_xxx" # 应用 B 的接收者
# 工作区路径(用于定位依赖技能)
export OPENCLAW_WORKSPACE="/path/to/workspace" # OpenClaw 工作区目录
```
### 必需工具
- `ffmpeg` - 音频格式转换、语速调整
- `ffprobe` - 读取音频信息
- `jq` - JSON 处理
### 依赖技能
- `coze-tts` - 文字转语音
## 快速开始
```bash
# 安装依赖(如果需要)
sudo apt-get install ffmpeg ffprobe jq
# 设置环境变量
export FEISHU_APP_ID="your_app_id"
export FEISHU_APP_SECRET="your_app_secret"
export COZE_API_KEY="your_coze_key"
# 发送语音消息(默认设置)
bash scripts/send_voice.sh "你好,这是一条语音消息"
# 指定 voice_id 和语速
bash scripts/send_voice.sh "你好" 2 1.2
```
## 使用方法
### 基本用法
```bash
# 发送语音消息
bash scripts/send_voice.sh "你好,这是一条语音消息"
```
### 高级选项
```bash
# 参数说明:
# - voice_id: Coze 音色 ID(默认 1)
# - 语速: 0.5-2.0(默认 1.0)
# - 接收者: 飞书 open_id(可选)
bash scripts/send_voice.sh "你好" 2 1.2 ou_xxx
```
## 技术细节
### 音频格式要求
飞书语音消息要求:
- **格式**: opus (OGG 容器)
- **编码**: libopus
- **比特率**: 24k
- **采样率**: 24000 Hz
- **声道**: 单声道
### Duration 参数
**关键**: 必须在上传时提供 `duration` 参数(整数毫秒),否则时长显示为 0。
```bash
# 获取时长(转换为毫秒)
DURATION_MS=$(ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 voice.opus | awk '{printf "%.0f", $1 * 1000}')
# 上传时带上 duration(毫秒)
curl ... -F "duration=$DURATION_MS"
```
## 故障排查
### 语音没有时长
**问题**: 发送的语音消息时长显示为 0
**解决**: 确保在上传时传递了 `duration` 参数(整数毫秒)
### 无法播放
**可能原因**:
1. 格式不是 opus
2. `file_type` 参数错误
3. 文件损坏
**解决**:
```bash
# 检查格式
ffprobe voice.opus
# 重新转换
ffmpeg -i input.mp3 -c:a libopus -b:a 24k voice.opus
```
### API 权限错误
**问题**: 上传时返回权限错误
**解决**: 确保飞书应用有以下权限:
- `im:message`
- `im:message:send_as_bot`
## 相关技能
- `coze-tts`: 文字转语音
- `coze-asr`: 语音转文字
## Author
franklu0819-lang
## License
MIT_meta.json
{
"ownerId": "kn784af36jyc12gczmcr7fq0a981dbhr",
"slug": "feishu-voice",
"version": "1.2.0",
"publishedAt": 1774710815856
}references/feishu_voice_api.md
# 飞书语音消息 API 参考
## 接口信息
### 获取访问令牌
- **接口**: `POST /auth/v3/tenant_access_token/internal`
- **用途**: 获取飞书 API 访问令牌
### 上传文件
- **接口**: `POST /im/v1/files`
- **用途**: 上传语音文件到飞书服务器
**关键参数**:
- `file_type=opus` - 文件类型必须是 opus
- `duration` - 音频时长(毫秒,整数)
### 发送消息
- **接口**: `POST /im/v1/messages?receive_id_type=open_id`
- **用途**: 发送语音消息
**消息格式**:
```json
{
"receive_id": "ou_xxx",
"msg_type": "audio",
"content": "{\"file_key\": \"xxx\", \"duration\": 6000}"
}
```
## 音频格式要求
| 参数 | 要求 |
|------|------|
| 格式 | opus (OGG 容器) |
| 编码 | libopus |
| 比特率 | 24k |
| 采样率 | 24000 Hz |
| 声道 | 单声道 |
## 环境变量说明
### 必需变量
| 变量名 | 说明 |
|--------|------|
| FEISHU_APP_ID | 飞书应用 ID |
| FEISHU_APP_SECRET | 飞书应用密钥 |
| COZE_API_KEY | Coze API 密钥 |
### 可选变量
| 变量名 | 说明 |
|--------|------|
| FEISHU_RECEIVER | 默认接收者 Open ID |
| FEISHU_APP_ID_B | 应用 B 的 ID(多应用场景) |
| FEISHU_APP_SECRET_B | 应用 B 的密钥 |
| FEISHU_RECEIVER_B | 应用 B 的接收者 |
| OPENCLAW_WORKSPACE | OpenClaw 工作区目录路径 |
## TTS 脚本路径解析
脚本会按以下顺序尝试找到 coze-tts:
1. **相对路径**: `../coze-tts/scripts/text_to_speech.sh`(相对于当前技能目录)
2. **环境变量**: `$OPENCLAW_WORKSPACE/skills/coze-tts/scripts/text_to_speech.sh`
3. **常见路径**: 尝试 `$HOME/.openclaw/workspace`、`$HOME/openclaw/workspace`、`/opt/openclaw/workspace`
## 官方文档
https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/createskill-card.md
## Description: Feishu Voice converts text to speech with coze-tts, converts the audio to Feishu-compatible opus format, uploads it, and sends it as a playable Feishu voice message. This skill is ready for commercial/non-commercial use. ## Publisher: [franklu0819-lang](https://clawhub.ai/user/franklu0819-lang) ### License/Terms of Use: MIT-0 ## Use Case: Developers and operators use this skill to automate sending generated voice messages into Feishu chats from text input, with optional voice, speed, and receiver parameters. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill sends user text and generated audio through external Feishu and Coze services while using local credentials. Mitigation: Use minimally scoped Feishu and Coze credentials, restrict the Feishu app permissions to the needed chat workflow, and avoid sensitive text unless the data path is approved. Risk: The skill executes a local coze-tts dependency that may inherit environment secrets. Mitigation: Install coze-tts only from a trusted local path and review that dependency before running this skill with production credentials. Risk: Temporary audio files are created on the local machine during conversion. Mitigation: Run the skill in a trusted or isolated workspace and avoid shared machines for sensitive voice content until temporary-file handling is hardened. ## Reference(s): - [ClawHub Feishu Voice skill page](https://clawhub.ai/franklu0819-lang/skills/feishu-voice) - [Feishu voice API reference](artifact/references/feishu_voice_api.md) - [Feishu message create documentation](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message/create) ## Skill Output: **Output Type(s):** [Shell commands, Configuration, API Calls, Files, Text] **Output Format:** [Markdown guidance with bash command examples; runtime output is terminal status text and a Feishu voice message side effect.] **Output Parameters:** [1D] **Other Properties Related to Output:** [Requires ffmpeg, ffprobe, jq, Feishu credentials, a Coze API key, and the coze-tts dependency; generates temporary local audio files during execution.] ## Skill Version(s): 1.2.0 (source: server release metadata) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/franklu0819-lang/skills/feishu-voice",
"sourceUrl": "https://clawhub.ai/franklu0819-lang/skills/feishu-voice",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T14:21:53.787Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-feishu-voice/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-feishu-voice/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T14:21:53.787Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "2.5K downloads",
"href": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceUrl": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T14:21:53.787Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.2.0",
"href": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceUrl": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-28T15:13:35.856Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-feishu-voice/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-franklu0819-lang-feishu-voice/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.2.0",
"description": "优化Token获取逻辑,修复参数错误,增加默认配置支持",
"href": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceUrl": "https://clawhub.ai/franklu0819-lang/feishu-voice",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-03-28T15:13:35.856Z",
"isPublic": true
}
]
}Record generated Oct 9, 2026.
