← 返回 Skills 市场
li-neo

Feishu Voice Chat

作者 neo · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ✓ 安全检测通过
175
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install feishu-voice-chat
功能描述
飞书语音对话能力,提供语音识别(ASR)和语音合成(TTS)功能, 所有的飞书语音消息都通过该技能处理。 完整语音交互链路:接收用户语音 → ASR 转文字 → LLM 处理 → TTS 转语音 → 通过飞书插件发送语音消息。 当用户要求"语音回复/说给我听"时,只回复飞书语音消息(audio 气泡),不回复文本...
使用说明 (SKILL.md)

飞书语音对话 (Feishu Voice Chat)

本 Skill 集成了火山引擎 (Volcengine) 的语音技术,赋予 OpenClaw 机器人"听"和"说"的能力。

完整语音交互链路

用户(手机飞书 App)
    │
    ▼ 发送语音消息
┌──────────────────────────────────────────────────────────────┐
│ 飞书服务器                                                    │
│  • 语音格式:OGG 容器 + Opus 编码 + 48kHz 采样               │
│  • 消息类型:msg_type="audio"                               │
│  • content: {"file_key": "file_xxx", "duration": 5000}      │
└──────────────────────────────────────────────────────────────┘
    │
    ▼ OpenClaw 接收事件
┌──────────────────────────────────────────────────────────────┐
│ openclaw-lark 插件                                           │
│  • convertAudio() 解析 file_key                              │
│  • 下载语音到本地临时文件(/tmp/openclaw/media/inbound/*.ogg)│
│  • AI 收到:\x3Caudio key="file_xxx" duration="5s"/> + 文件路径  │
└──────────────────────────────────────────────────────────────┘
    │
    ▼ 调用 ASR
┌──────────────────────────────────────────────────────────────┐
│ feishu-voice-chat / ASR(语音→文字)                          │
│  • volc_voice.py asr \x3C本地音频路径>                           │
│  • 火山引擎大模型 ASR (V3),高精度识别                       │
│  • 返回 JSON: {"status": "success", "text": "识别出的文字"}   │
└──────────────────────────────────────────────────────────────┘
    │
    ▼ LLM 处理
┌──────────────────────────────────────────────────────────────┐
│ OpenClaw LLM                                                 │
│  • 理解用户意图,生成回复内容                                  │
│  • 若需要语音回复 → 进入 TTS 流程                              │
└──────────────────────────────────────────────────────────────┘
    │
    ▼ 调用 TTS
┌──────────────────────────────────────────────────────────────┐
│ feishu-voice-chat / TTS(文字→语音)                          │
│  • feishu_voice.py speak \x3C回复文本> [output_path] [reply_to]  │
│  • 火山引擎大模型 TTS (V3),生成 .ogg 音频文件                │
│  • 自动返回 message 工具调用指令                              │
└──────────────────────────────────────────────────────────────┘
    │
    ▼ 调用 message 工具发送
┌──────────────────────────────────────────────────────────────┐
│ openclaw-lark 插件 / message 工具                             │
│  • message(action="send", channel="feishu",                  │
│  •           msg_type="audio", media="\x3Caudio_file_path>")    │
│  • 内部自动:uploadFileLark(file_type="opus") → 获得 file_key │
│  •          sendAudioLark(content={"file_key": "file_xxx"})  │
│  • 用户收到:语音气泡(audio 消息,可直接播放)                 │
└──────────────────────────────────────────────────────────────┘
    │
    ▼
用户(手机飞书 App)

功能特性

  • 高精度语音识别 (ASR): 使用火山引擎大模型 ASR (V3),支持长语音和流式识别,准确率高。
  • 自然语音合成 (TTS): 使用火山引擎 TTS (V3),输出 .ogg 格式(适配飞书语音消息),支持流式生成。
  • 飞书插件深度集成: 通过 openclaw-lark 的 message 工具自动上传并发送语音消息,用户收到的是可直接播放的语音气泡。

前置准备

  1. 注册火山引擎账号: 访问 火山引擎语音服务控制台
  2. 创建应用: 在控制台创建一个应用,获取 AppIDAccess Token注意:这是语音服务的凭证,不同于火山引擎 ARK API 的 Key)。
  3. 开通服务: 为应用开通「大模型语音合成 TTS」和「大模型录音文件识别 ASR」两个服务。
  4. 安装依赖: pip install -r requirements.txt

配置说明

  1. 复制 .env.example.env
    cp .env.example .env
    
  2. 编辑 .env,填入你的火山引擎凭证:
    VOLC_APPID=你的AppID
    VOLC_ACCESS_TOKEN=你的Access Token
    
变量名 说明 默认值
VOLC_APPID 火山引擎应用 ID(必填) -
VOLC_ACCESS_TOKEN 访问令牌(必填) -
VOLC_RESOURCE_ID TTS 资源 ID seed-tts-1.0
VOLC_VOICE_TYPE TTS 音色代码 zh_female_sajiaonvyou_moon_bigtts
VOLC_RESOURCE_ID_ASR ASR 资源 ID volc.bigasr.auc

使用指南

1. 语音识别(ASR)—— 语音 → 文字

当机器人收到用户语音消息时,使用此命令将音频转为文本。

python3 scripts/volc_voice.py asr /path/to/user_audio.ogg

输出示例 (JSON):

{"status": "success", "text": "你好,请问今天天气怎么样?"}

2. 语音合成(TTS)—— 文字 → 语音

当需要回复语音时,使用此命令将文本转为音频,并自动生成 message 工具调用指令。

# 基本用法
python3 scripts/feishu_voice.py speak "今天天气不错,适合出去玩哦。"

# 指定输出路径和回复目标(在话题中回复)
python3 scripts/feishu_voice.py speak "好的没问题!" /tmp/reply.ogg om_xxx

输出示例:

🔊 正在合成语音: 今天天气不错...
✅ 合成成功: /tmp/openclaw/voice-tts/reply_1234567890.ogg
{"status": "success", "audio_file": "/tmp/openclaw/voice-tts/reply_1234567890.ogg", "message_cmd": "message(action=\"send\", channel=\"feishu\", msg_type=\"audio\", media=\"/tmp/openclaw/voice-tts/reply_1234567890.ogg\")"}

============================================================
音频文件 / Audio file: /tmp/openclaw/voice-tts/reply_1234567890.ogg
发送指令 / Send command: message(action="send", channel="feishu", msg_type="audio", media="/tmp/openclaw/voice-tts/reply_1234567890.ogg")
============================================================

OpenClaw Agent 接入指南

在 Agent System Prompt 中添加以下指令

语音交互能力:

  • 当用户发送语音消息(你会收到一个文件路径或 \x3Caudio key="..."/> 占位符)时,请调用 feishu-voice-chat 的 ASR 功能识别内容。
  • 当用户要求"语音回复/说给我听"时,请先生成文本回复,然后调用 feishu-voice-chat 的 TTS 功能生成 .ogg 音频文件,最后使用飞书插件的 message 工具将音频以 msg_type="audio" 发送给用户。
  • 重要:语音回复只发送语音消息,不发送文本消息,不发送文件附件。用户收到的是可直接播放的语音气泡。

工具调用示例(供 Agent 参考)

接收用户语音:

# 用户发送语音 → AI 调用 ASR
python3 scripts/volc_voice.py asr /tmp/openclaw/media/inbound/voice_xxx.ogg
# → 返回: {"status": "success", "text": "你好"}

# AI 处理后决定语音回复 → 调用 TTS
python3 scripts/feishu_voice.py speak "你好,有什么可以帮助你的吗?"
# → 返回 JSON 含 audio_file 和 message_cmd

# AI 调用 message 工具发送语音
message(action="send", channel="feishu", msg_type="audio", media="/tmp/openclaw/voice-tts/reply_xxx.ogg")
# → 用户在飞书收到语音气泡

测试步骤

  1. 配置凭证后,运行 TTS 测试:

    cd /Users/bytedance/.openclaw/workspace/skills/feishu-voice-chat
    python3 scripts/feishu_voice.py speak "你好,这是飞书语音对话测试。"
    

    验证: 终端输出 ✅ 合成成功,且生成 /tmp/openclaw/voice-tts/reply_*.ogg 文件。

  2. 运行 ASR 测试:

    python3 scripts/volc_voice.py asr /tmp/openclaw/voice-tts/reply_*.ogg
    

    验证: 终端输出 {"status": "success", "text": "..."},识别出的文字与 TTS 输入一致。

  3. 完整链路测试: 在飞书 App 中对机器人发送一条语音,观察 Agent 是否正确识别并语音回复。

故障排除

  • Error: 请在 .env 文件中配置...: 检查 .env 文件是否存在且内容正确。
  • Requested resource not granted (45000030):
    • 检查 VOLC_RESOURCE_ID 是否正确。
    • 如果是 TTS,尝试使用 seed-tts-1.0
    • 如果是 ASR,尝试使用 volc.bigasr.auc
    • 确认你的火山引擎应用是否已关联了相应的语音技术服务。
  • TTS/ASR Timeout: 检查网络连接,确保能访问 openspeech.bytedance.com
  • 飞书发送失败: 确认 openclaw-lark 插件已正确安装并配置了飞书机器人。
安全使用建议
This skill appears to do exactly what it claims: convert incoming Feishu audio to text with Volcengine ASR and synthesize audio with Volcengine TTS, then return an agent 'message' command to send the audio. Before installing: 1) Be aware that all audio and text are sent to Volcengine endpoints (Bytedance domains shown in the scripts) — ensure you are comfortable with that privacy/third‑party processing. 2) Provide only the Volcengine credentials (VOLC_APPID and VOLC_ACCESS_TOKEN) required; do not reuse broader platform or AWS/GCP credentials. 3) Install ffmpeg on the host (the scripts call ffmpeg for format conversion but the skill metadata did not list it as a required binary). 4) Confirm the skill is installed where the scripts expect (.openclaw/workspace/skills/feishu-voice-chat or adjust SCRIPT_PATH) or edit the wrapper script accordingly. 5) Review .env placement and file permissions so the VOLC tokens stay protected. If you need higher assurance, audit network traffic to the declared endpoints and inspect logs to confirm only audio/text related to user messages are transmitted.
功能分析
Type: OpenClaw Skill Name: feishu-voice-chat Version: 0.1.1 The skill bundle provides voice recognition (ASR) and synthesis (TTS) capabilities for Feishu (Lark) by integrating with Volcengine (ByteDance) APIs. The implementation in `scripts/volc_voice.py` and `scripts/feishu_voice.py` follows standard practices, including a security-conscious `is_safe_path` function to mitigate path traversal risks and the use of safe subprocess execution. The instructions in `SKILL.md` are appropriately scoped to define the agent's behavior for voice interactions, and no evidence of malicious intent, unauthorized data exfiltration, or command injection was found.
能力评估
Purpose & Capability
Name/description, declared env vars (VOLC_*), SKILL.md usage, and the two scripts all align: they implement ASR and TTS via Volcengine and return an agent message command to send audio via the Feishu plugin. One minor inconsistency: the scripts call ffmpeg for format conversion but the skill metadata lists no required binaries; ffmpeg should be declared as a required binary.
Instruction Scope
SKILL.md instructs running the included scripts with local audio paths. The scripts only read audio files from /tmp/openclaw media paths (and other allowed temp dirs), load a local .env for VOLC credentials, call Volcengine endpoints for ASR/TTS, optionally convert with ffmpeg, and emit a structured message_cmd for the agent to call the message tool. They do not attempt to read unrelated user files or exfiltrate arbitrary data beyond sending audio/text to the declared TTS/ASR endpoints. The scripts also implement path checks to limit accessible paths.
Install Mechanism
This is an instruction-only skill with included Python scripts and a small requirements.txt (requests, python-dotenv). There is no remote download or archive extraction. Installation risk is low. Note: the skill relies on an external binary (ffmpeg) but does not declare it in the metadata.
Credentials
The only required environment variables are VOLC_APPID and VOLC_ACCESS_TOKEN (plus optional VOLC_* settings) which are appropriate for the declared Volcengine ASR/TTS integration. No unrelated credentials or broad secrets are requested. The scripts load a local .env from the skill directory and also permit reading these env vars from the environment, which is expected for service auth.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or global agent configuration. It writes temporary audio files under /tmp/openclaw and relies on normal subprocess calls; privileges are limited to the agent's runtime environment.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-voice-chat
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-voice-chat 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
- Added explicit environment variable metadata to SKILL.md, documenting all relevant environment variables and their purpose. - No core functionality changes; all updates are documentation improvements to clarify setup and configuration. - Updated SKILL.md to include an `env` section for better clarity and integration guidance.
v0.1.0
feishu-voice-chat v0.1.0 - Initial release providing Feishu voice chat capabilities for OpenClaw using Volcengine APIs. - Supports automatic speech recognition (ASR) and text-to-speech (TTS); all Feishu voice messages are processed by this skill. - Enables end-to-end voice interaction: receive voice → ASR → LLM processing → TTS → reply via Feishu audio bubble. - Integrates with openclaw-lark for seamless Feishu audio message sending. - Includes clear CLI usage, setup, and troubleshooting instructions.
元数据
Slug feishu-voice-chat
版本 0.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Feishu Voice Chat 是什么?

飞书语音对话能力,提供语音识别(ASR)和语音合成(TTS)功能, 所有的飞书语音消息都通过该技能处理。 完整语音交互链路:接收用户语音 → ASR 转文字 → LLM 处理 → TTS 转语音 → 通过飞书插件发送语音消息。 当用户要求"语音回复/说给我听"时,只回复飞书语音消息(audio 气泡),不回复文本... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 175 次。

如何安装 Feishu Voice Chat?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-voice-chat」即可一键安装,无需额外配置。

Feishu Voice Chat 是免费的吗?

是的,Feishu Voice Chat 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Feishu Voice Chat 支持哪些平台?

Feishu Voice Chat 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Feishu Voice Chat?

由 neo(@li-neo)开发并维护,当前版本 v0.1.1。

💬 留言讨论