# Send Feishu Voice to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "feishu-voice",
    "name": "Feishu Voice",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/franklu0819-lang/feishu-voice",
    "canonicalUrl": "https://clawhub.ai/franklu0819-lang/feishu-voice",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/feishu-voice",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-voice",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "package.json",
      "scripts/send_voice.sh",
      "scripts/send_voice_auto.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "feishu-voice",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T02:00:59.101Z",
      "expiresAt": "2026-05-07T02:00:59.101Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-voice",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=feishu-voice",
        "contentDisposition": "attachment; filename=\"feishu-voice-1.2.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "feishu-voice"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/feishu-voice"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/feishu-voice",
    "downloadUrl": "https://openagent3.xyz/downloads/feishu-voice",
    "agentUrl": "https://openagent3.xyz/skills/feishu-voice/agent",
    "manifestUrl": "https://openagent3.xyz/skills/feishu-voice/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/feishu-voice/agent.md"
  }
}
```
## Documentation

### 飞书语音消息发送技能

将文本转换为语音消息发送到飞书，支持在飞书聊天窗口直接播放。

### 功能特性

✅ TTS 文字转语音（使用 zhipu-tts）
✅ 自动转换为 opus 格式（飞书要求）
✅ 读取音频时长
✅ 上传到飞书服务器
✅ 发送可播放的语音消息
✅ 支持多种声音和语速

### 环境变量

# 飞书配置
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）

### send_voice.sh

主脚本，完整的语音消息发送流程。

用法：

bash scripts/send_voice.sh <文本> [声音] [语速]

参数：

文本 (必需): 要转换为语音的文字
声音 (可选): tongtong, chuichui, xiaochen（默认：tongtong）
语速 (可选): 0.5-2.0（默认：1.0）

环境变量：

FEISHU_APP_ID: 飞书应用 ID
FEISHU_APP_SECRET: 飞书应用密钥
FEISHU_RECEIVER: 接收者 Open ID（可选）

### 流程说明

TTS 生成: 使用 zhipu-tts 生成 WAV 格式音频
格式转换: 使用 ffmpeg 转换为 opus 格式
读取时长: 使用 ffprobe 获取音频时长（秒）
上传文件: 上传到飞书，指定 file_type=opus 和 duration
发送消息: 发送 msg_type=audio 消息

### 音频格式要求

飞书语音消息要求：

格式: opus (OGG 容器)
编码: libopus
比特率: 24k
采样率: 24000 Hz
声道: 单声道

### Duration 参数

关键: 必须在上传时提供 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"          # ← 关键参数

### API 端点

端点用途/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"

### 无法播放

问题: 语音消息无法播放

可能原因:

格式不是 opus
file_type 参数错误
文件损坏

解决:

# 检查格式
ffprobe voice.opus

# 重新转换
ffmpeg -i input.wav -c:a libopus -b:a 24k voice.opus

### API 权限错误

问题: 上传时返回权限错误

解决: 确保飞书应用有以下权限：

im:message
im: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 \\
  "你好，这是一条测试语音消息。"

### 注意事项

时长限制: 智谱 TTS 单次最多 1024 字符
整数时长: duration 必须是整数（四舍五入）
opus 格式: 飞书只接受 opus 格式的音频消息
文件清理: 临时文件会自动清理

### 相关技能

zhipu-tts: 文字转语音
zhipu-asr: 语音转文字
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: franklu0819-lang
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T02:00:59.101Z
- Expires at: 2026-05-07T02:00:59.101Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/feishu-voice)
- [Send to Agent page](https://openagent3.xyz/skills/feishu-voice/agent)
- [JSON manifest](https://openagent3.xyz/skills/feishu-voice/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/feishu-voice/agent.md)
- [Download page](https://openagent3.xyz/downloads/feishu-voice)