微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔊

飞书语音消息,AI 合成与识别

Feishu Voice (ElevenLabs) · v1.1.0
办公 安全 B 级 作者 dongdongbear 公开目录收录
976 下载 0 安装 4k 收藏 43 浏览

简介

通过 ElevenLabs 语音合成与语音识别,在飞书实现发送语音消息和转录接收语音,支持智能回复模式自动匹配回复方式。

原始描述

Send and receive voice messages on Feishu (Lark) using ElevenLabs TTS and STT. Activate when user asks to send a voice message on Feishu, or when receiving a...

通过你的 Agent 添加

安装目录:feishu-voice/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/feishu-voice-elevenlabs/
Codex CLI~/.codex/skills/feishu-voice-elevenlabs/
DeepSeek Harness~/.agents/skills/feishu-voice-elevenlabs/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Feishu Voice 是面向飞书(Lark)平台的语音消息处理技能,整合 ElevenLabs TTS(文字转语音)与 STT(语音转文字)能力,实现双向语音通信。

发送语音(TTS):用户输入文字后,通过 ElevenLabs 合成自然语音,以 audio 消息类型发送至指定飞书用户或群聊。支持调节语速(0.5-2.0倍),需配置 ElevenLabs API Key、飞书应用凭证及指定音色 ID。

接收语音(STT):当飞书收到语音消息(.ogg/.opus 附件)时,自动调用 ElevenLabs Scribe 模型转录为文字,支持中文、英文等 90+ 语言自动检测。若仅获取到 file_key,可通过飞书 API 下载后处理。

智能回复模式:根据接收消息类型自动决策——收到语音则语音回复,收到文字则文字回复,用户也可显式指定回复方式。

显著优点

  • 自然语音质量:ElevenLabs 提供行业领先的神经网络语音合成,支持多语种及情感表达
  • 双向完整闭环:同时覆盖发送与接收场景,实现真正对话式体验
  • 灵活配置:支持语速调节、多模型选择(multilingual_v2 适配中文,v3 优化英语)
  • 生态整合:与 OpenClaw 框架深度集成,自动读取飞书凭证配置

潜在缺点与局限性

  • 付费门槛:Library 音色需要 ElevenLabs 付费计划,免费账户仅限预设音色
  • 外部依赖重:需维护 ElevenLabs、飞书 API、ffmpeg 等多处外部服务可用性
  • 网络延迟:TTS/STT 均需云端处理,实时性受网络影响
  • 配置复杂度:环境变量多达 6 项,涉及 API Key、应用凭证、音色参数等
  • 格式限制:飞书严格要求 msg_type 为 "audio",asVoice 参数存在兼容性问题

适合人群

  • 需要在飞书场景提供语音交互能力的 AI 助手开发者
  • 面向中老年用户或特定场景(驾驶、视障辅助)的语音优先产品
  • 希望构建自然对话体验的企业微信/飞书智能客服系统

常规风险

风险类别 说明
API 密钥泄露 ElevenLabs 与飞书凭证均需妥善保管,避免硬编码
成本失控 ElevenLabs 按字符/分钟计费,高频使用需监控用量
隐私合规 语音数据经 ElevenLabs 云端处理,涉及语音内容需评估数据跨境合规性
服务中断 任一外部服务故障将导致功能不可用,需设计降级方案

技能正文


name: feishu-voice description: Send and receive voice messages on Feishu (Lark) using ElevenLabs TTS and STT. Activate when user asks to send a voice message on Feishu, or when receiving a Feishu audio message (media attachment with .ogg/.opus file) that needs transcription. Supports smart reply mode — auto voice-reply to voice messages, text-reply to text messages.

Feishu Voice (TTS + STT)

Send voice messages and transcribe received voice messages on Feishu using ElevenLabs.

Prerequisites

  • sag CLI (ElevenLabs TTS): npm i -g sag or go install
  • ffmpeg / ffprobe: brew install ffmpeg
  • ElevenLabs paid plan (required for library voices)
  • Feishu app with im:message:send_as_bot and im:file permissions

Environment Variables

Variable Required Description
ELEVENLABS_API_KEY ✅ ElevenLabs API key
FEISHU_APP_ID ✅ (TTS) Feishu app ID
FEISHU_APP_SECRET ✅ (TTS) Feishu app secret
ELEVENLABS_VOICE_ID ✅ (TTS) Voice ID (browse at elevenlabs.io/voice-library)
ELEVENLABS_MODEL_ID ✅ (TTS) Model ID (e.g. eleven_multilingual_v2, eleven_v3)
ELEVENLABS_SPEED ❌ Speech speed 0.5-2.0 (default: 1.0)

If FEISHU_APP_ID / FEISHU_APP_SECRET are not in env, extract from openclaw config:

export FEISHU_APP_ID=$(python3 -c "import json; print(json.load(open('$HOME/.openclaw/openclaw.json'))['channels']['feishu']['appId'])")
export FEISHU_APP_SECRET=$(python3 -c "import json; print(json.load(open('$HOME/.openclaw/openclaw.json'))['channels']['feishu']['appSecret'])")

Voice Selection

See config/voice-config.example.json for a curated voice list. Browse all voices at https://elevenlabs.io/voice-library or run sag voices.

Recommended models:

  • eleven_multilingual_v2 — best for Chinese and multilingual content
  • eleven_v3 — latest English-optimized model

Sending Voice Messages (TTS)

scripts/feishu-voice-send.sh <text> <receive_id> [receive_id_type] [speed]
  • receive_id: target user open_id or chat_id
  • receive_id_type: open_id (default) or chat_id
  • speed: speech speed multiplier, 0.5-2.0 (default: 1.0)

Receiving Voice Messages (STT)

When OpenClaw delivers a Feishu voice message, it arrives as a media attachment (.ogg file). Transcribe with:

scripts/feishu-voice-stt.sh /path/to/audio.ogg

Returns recognized text to stdout. Uses ElevenLabs scribe_v1 model with automatic language detection.

Fallback: Download via Feishu API

If the audio file is not delivered as an attachment (only file_key available):

  1. List recent messages: GET /im/v1/messages?container_id_type=chat&container_id=CHAT_ID&page_size=5&sort_type=ByCreateTimeDesc
  2. Download audio: GET /im/v1/messages/{message_id}/resources/{file_key}?type=file
  3. Run STT script on the downloaded file

Smart Reply Mode

When receiving messages, follow this pattern for natural conversation:

  • Voice message received → transcribe with STT → understand → reply with voice (TTS)
  • Text message received → understand → reply with text
  • Override: user can request voice/text reply explicitly

Important Notes

  • Feishu msg_type must be "audio" — not "media" or "file"
  • OpenClaw's message tool asVoice does not work correctly for Feishu — use this script instead
  • STT uses ElevenLabs scribe_v1 model, supports Chinese, English, and 90+ languages
  • For free ElevenLabs accounts, only premade voices work; library voices require a paid plan

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

feishularkvoicettssttelevenlabsmessagingenterprisecommunication

同类 Skill