← 返回 Skills 市场
sunxq1017-hash

飞书语音发送器(TTS) Feishu Voice Sender

作者 sunxq1017 · GitHub ↗ · v2.0.2 · MIT-0
cross-platform ✓ 安全检测通过
234
总下载
2
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install feishu-voice-sender-tts
功能描述
飞书语音发送器 | Feishu Voice Sender 支持 TTS 语音合成,以及可选的 ASR 语音识别功能。 当用户明确要求发送飞书语音消息时调用此工具,例如:发语音、用语音回复、发送语音消息等。 This skill may be invoked only when the user explicit...
使用说明 (SKILL.md)

飞书语音发送器 Feishu Voice Sender

支持 TTS 语音合成,以及可选的 ASR 语音识别功能,同时支持基于上下文的情绪参数。

⚠️ 重要声明

执行模式 | Execution Model

  • 此 Skill 不会自动运行,仅在用户明确要求时执行
  • This skill does not monitor, intercept, or automatically process messages. It only runs when explicitly invoked.
  • 仅处理用户提供的输入,不读取任意本地文件
  • Only processes user-provided input. Does not read arbitrary local files.

外部依赖 | External Dependencies

  • ffmpeg: 仅用于音频格式转换(mp3 → opus),不执行任意命令
  • ffmpeg is used ONLY for audio format conversion (mp3 → opus). No arbitrary command execution. No user-controlled shell input.

触发场景 | Invocation Examples

当用户明确要求发送飞书语音消息时,可调用此 Skill,例如:

  • "发语音给..."
  • "用语音回复"
  • "发送语音消息"
  • "voice message"
  • "send voice"

This skill may be invoked only when the user explicitly requests a voice message via Feishu/Lark. It does not run automatically.

AI 使用方法

当用户明确要求时,使用以下方式发送语音:

import sys
sys.path.insert(0, 'src')
from feishu_voice import send_voice_message

# 发送语音消息
send_voice_message(
    text="要播报的内容",
    user_input="用户的原始请求(用于情绪感知)"
)

参数说明:

  • text: AI 生成的播报内容(必填,最大 300 字符)
  • user_input: 用户的原始输入,用于让豆包感知情绪(可选)
  • receive_id: 接收者 ID(可选,默认从环境变量读取)

示例:

# 用户说:"用激动的语气发语音说项目成功了"
send_voice_message(
    text="项目成功了!我们超额完成了目标!",
    user_input="用激动的语气发语音说项目成功了"
)

数据流 | Data Flow

Text path: 用户提供文本 → 情绪上下文参数 → TTS 语音合成 → 格式转换 → 飞书发送

ASR path: 用户明确提供本地音频文件(当前支持 .ogg / OGG Opus 输入)→ 极速版 ASR(flash recognize API)→ 返回文本结果

环境变量配置

必需配置(TTS + Feishu)

export TTS_APP_ID="your-tts-app-id"
export TTS_ACCESS_KEY="your-tts-access-key"
export FEISHU_APP_ID="your-feishu-app-id"
export FEISHU_APP_SECRET="your-feishu-app-secret"

可选配置

# ASR 语音识别(仅在需要使用 ASR 功能时配置)
export ASR_APP_ID="your-asr-app-id"
export ASR_ACCESS_KEY="your-asr-access-key"
export ASR_RESOURCE_ID="volc.bigasr.auc_turbo"

# 默认接收者
export DEFAULT_RECEIVE_ID="ou_xxx"

注意: ASR 是可选功能,仅在调用语音识别时需要配置 ASR_APP_ID 和 ASR_ACCESS_KEY。若未显式提供 ASR_RESOURCE_ID,代码默认按本地文件极速识别场景使用 volc.bigasr.auc_turbo

获取方式:

功能特性

  • 🎙️ 语音合成(TTS) - 使用豆包 TTS 2.0 生成语音
  • 🎯 语音识别(ASR) - 使用豆包极速版 flash recognize API 识别本地 OGG/Opus 音频
  • 🎭 情绪参数 - 支持通过 context_texts 传递情绪上下文
  • 🔒 安全限制 - 仅处理用户提供的输入

安全说明 | Security

输入限制

  • 仅接受用户直接提供的文本输入
  • ASR 当前仅处理用户明确提供的 .ogg 音频文件(飞书语音常见为 OGG/Opus)
  • 文本长度限制 300 字符
  • 不读取任意本地文件,仅处理用户明确提供的 .ogg 音频文件用于 ASR

音频输入限制 | Audio Input Constraints

  • 仅处理用户明确提供的音频文件
  • Only processes audio files explicitly provided by the user
  • 不访问系统音频、麦克风或消息历史
  • Does NOT access system audio, microphone, or message history
  • 不扫描本地目录
  • Does NOT scan local directories

执行限制

  • 不监听消息
  • 不自动运行
  • 不扫描目录
  • 不执行用户控制的命令

临时文件

  • 使用 tempfile 模块创建临时文件
  • 处理完成后立即删除
  • 不保留任何持久文件

依赖

requests>=2.28.0

系统依赖:

  • ffmpeg(用于音频格式转换 mp3 → opus)
  • Python 3.8+

安装

pip install -r requirements.txt

注意: 需要系统安装 ffmpeg

  • macOS: brew install ffmpeg
  • Ubuntu: sudo apt-get install ffmpeg

项目结构

feishu-voice-sender-tts/
├── SKILL.md
├── requirements.txt
└── src/
    └── feishu_voice.py

更新日志

V2.0.2 (2026-03-24)

  • 🎯 修正本地音频 ASR 调用方式,改为 flash recognize API 所需的 JSON + base64 请求体
  • 🔧 新增 ASR_RESOURCE_ID 环境变量支持,默认适配本地文件极速识别场景
  • 🗣️ 明确桌面清洁版支持本地 OGG/Opus 音频识别
  • 📝 同步 SKILL.md 描述与实际实现,避免文档与代码不一致

V2.0.0 (2026-03-23)

  • 🔒 安全重构:移除所有硬编码密钥,改为环境变量
  • 🗑️ 删除 shell 脚本(send.sh / install.sh)
  • 🐍 纯 Python 实现:使用 requests 替代 curl
  • 🛡️ 增加安全限制:输入验证、文件类型检查、长度限制
  • 📝 重写 SKILL.md:明确声明执行模式和安全边界
  • 🧹 使用 tempfile 替代固定路径
  • 🔑 ASR/TTS 密钥分离
  • 💾 Feishu token 缓存
  • ⏱️ 动态音频时长计算
  • 🔒 ffmpeg 安全声明
  • 📝 文档降调,减少营销感
安全使用建议
This skill appears coherent for sending Feishu voice messages using Volcengine TTS/ASR and ffmpeg for format conversion. Before installing: (1) review the remainder of the source (the provided file output was truncated) to confirm there are no unexpected network calls or data sinks; (2) provide only the minimal credentials needed (use a Feishu app limited to the needed scopes, and only configure ASR keys if you will use ASR); (3) run in a restricted environment or test tenant first; (4) ensure ffmpeg is the official distribution; (5) rotate keys if you later remove the skill. If you want higher assurance, request the full, untruncated source for a complete review.
功能分析
Type: OpenClaw Skill Name: feishu-voice-sender-tts Version: 2.0.2 The skill provides Text-to-Speech (TTS) and Speech-to-Text (ASR) capabilities integrated with Feishu/Lark using Volcengine APIs. The implementation in src/feishu_voice.py includes appropriate security measures such as input length validation, file type checks for ASR, and safe usage of subprocess for audio conversion via ffmpeg. No evidence of malicious intent, data exfiltration, or unauthorized access was found.
能力评估
Purpose & Capability
Name/description (Feishu TTS + optional ASR) match the required env vars (TTS + Feishu credentials) and required binary (ffmpeg). The TTS and ASR endpoints in the code align with the described Volcengine/Feishu services.
Instruction Scope
SKILL.md explicitly limits operations to user-provided input and the code enforces input checks (max text length, .ogg-only ASR, file existence). Minor documentation nuance: SKILL.md says 'does not read arbitrary local files' — the code will open a local file when the user explicitly supplies a path for ASR (this is consistent with 'user-provided' but worth noting).
Install Mechanism
No installation script that downloads arbitrary code is present; the skill is instruction + a Python module and uses pip requirements (requests). This is low risk relative to download/extract installers. System dependency ffmpeg is required and documented.
Credentials
Requested env vars are proportional and expected: Volcengine TTS/ASR keys and Feishu app_id/app_secret. Primary credential is the Feishu secret as declared. Optional ASR keys are optional and only used when ASR functions are invoked.
Persistence & Privilege
Skill is not always-enabled and does not request persistent system-wide privileges. Token caching is in-memory only (module-level variable), and there is no evidence of modifying other skills or system configuration in the reviewed code.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-voice-sender-tts
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-voice-sender-tts 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.2
Fix local-file ASR for OGG/Opus via the flash recognize API, make ASR truly optional in configuration, add configurable ASR_RESOURCE_ID, and align documentation with implementation.
v2.0.1
Declare required env vars and ffmpeg in frontmatter metadata for scanner compliance
v2.0.0
Version 2.0.0 — Major security and architecture overhaul - All credentials must now be set via environment variables; no hardcoded secrets remain. - Fully rewritten in Python, replacing shell scripts and all usage of curl. - Enhanced security: strict input validation, file type/length restrictions, and temporary file handling. - ASR and TTS keys are now separated; Feishu tokens are cached. - New documentation clearly outlines usage model, security considerations, and installation steps. - Requires ffmpeg only for mp3→opus conversion, never executes arbitrary commands.
元数据
Slug feishu-voice-sender-tts
版本 2.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

飞书语音发送器(TTS) Feishu Voice Sender 是什么?

飞书语音发送器 | Feishu Voice Sender 支持 TTS 语音合成,以及可选的 ASR 语音识别功能。 当用户明确要求发送飞书语音消息时调用此工具,例如:发语音、用语音回复、发送语音消息等。 This skill may be invoked only when the user explicit... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 234 次。

如何安装 飞书语音发送器(TTS) Feishu Voice Sender?

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

飞书语音发送器(TTS) Feishu Voice Sender 是免费的吗?

是的,飞书语音发送器(TTS) Feishu Voice Sender 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

飞书语音发送器(TTS) Feishu Voice Sender 支持哪些平台?

飞书语音发送器(TTS) Feishu Voice Sender 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 飞书语音发送器(TTS) Feishu Voice Sender?

由 sunxq1017(@sunxq1017-hash)开发并维护,当前版本 v2.0.2。

💬 留言讨论