Skip to content
Back to skills

Feishu Audio

ASecurity

将音频文件转换为飞书可播放的语音消息。先用 ffmpeg 转为 opus 格式,再上传到飞书,最后发送 audio 消息。适用于用户想要在飞书中收到可播放的语音消息的场景。

  • 14 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
toolsbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill feishu-audio --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Feishu Audio?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Feishu Audio
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-feishu-audio/badge)](https://www.skillsdirectory.com/skills/modbender-feishu-audio)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: feishu-audio
description: 将音频文件转换为飞书可播放的语音消息。先用 ffmpeg 转为 opus 格式,再上传到飞书,最后发送 audio 消息。适用于用户想要在飞书中收到可播放的语音消息的场景。
---

# feishu-audio

将本地音频文件转换为飞书可播放的语音消息。

## 适用场景

- 用户说"朗读 xxx"、"语音播报"
- 需要发送可播放的语音消息到飞书

## 前置条件

1. **ffmpeg** - 音频格式转换
   ```bash
   brew install ffmpeg
   ```

2. **飞书应用配置** - 需要以下环境变量:
   - `FEISHU_APP_ID`
   - `FEISHU_APP_SECRET`

3. **接收者** - 飞书用户 Open ID(从上下文获取或手动指定)

## 使用方法

### 方式 1:使用已有音频文件

```bash
bash scripts/send_audio.sh <音频文件路径> [接收者OpenID]
```

### 方式 2:结合 TTS 使用

先生成音频,再用本技能发送:

```bash
# 1. 用 edge-tts 生成音频
edge-tts -t "你好,我是小曦" -v zh-CN-XiaoxiaoNeural --write-media /tmp/voice.mp3

# 2. 转为 opus 并发送到飞书
bash scripts/send_audio.sh /tmp/voice.mp3
```

## 脚本说明

### send_audio.sh

主脚本,完整的音频消息发送流程。

**参数:**
- `$1` - 音频文件路径(必需)
- `$2` - 接收者 Open ID(可选,默认从环境变量 FEISHU_RECEIVER 获取)

**环境变量:**
- `FEISHU_APP_ID` - 飞书应用 ID
- `FEISHU_APP_SECRET` - 飞书应用密钥
- `FEISHU_RECEIVER` - 接收者 Open ID(可选)

**流程:**
1. 检查 ffmpeg 是否可用
2. 检查音频文件是否存在
3. 用 ffmpeg 转换为 opus 格式(飞书要求)
4. 获取飞书 tenant_access_token
5. 上传到飞书(file_type=opus)
6. 发送 audio 消息

## 音频格式要求

飞书语音消息要求:
- **格式**: opus (OGG 容器)
- **编码**: libopus
- **采样率**: 24000 Hz
- **声道**: 单声道

## 故障排查

### ffmpeg 未安装

```bash
brew install ffmpeg
```

### 上传失败

检查飞书应用权限:
- `im:message`
- `im:message:send_as_bot`

### 消息发送成功但无法播放

确认:
1. 上传时使用了 `file_type=opus`
2. 上传时传递了 `duration` 参数

Files in this skill

  • SKILL.md2.2 KB
  • scripts/send_audio.sh3.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…