feishu-voice-tts

将文本转为语音并通过飞书 audio 消息发送给指定用户。用于“给用户发语音”“把这段话转语音并发飞书”“语音播报结果”等场景,尤其当普通文件发送会降级为文本时使用。仅在指定 channel=feishu 时触发。优先在需要高可达、可听播报时使用。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "feishu-voice-tts" with this command: npx skills add Tangc/feishu-send-voice

Feishu Voice TTS

Overview

把文本转换为语音(edge-tts),再转码为飞书可用的 Opus(OGG 容器),调用飞书开放平台“先上传文件再发 audio 消息”的标准流程发送,避免“直接发文件被降级成文本”。

Quick Start

执行脚本:

skills/feishu-voice-tts/scripts/send_feishu_voice.sh "用户你好,这是一条语音消息" "user_open_id"

参数:

  1. text(必填)要播报的文本
  2. open_id(必填,可用环境变量替代)飞书用户 open_id
  3. voice(可选)edge-tts 音色,默认 zh-CN-YunxiNeural

环境变量(可选,优先级高于配置文件):

  • FEISHU_APP_ID
  • FEISHU_APP_SECRET
  • FEISHU_OPEN_ID
  • EDGE_TTS_VOICE

Workflow

按以下顺序执行,不要跳步:

  1. 文本转语音:edge-tts 生成 mp3
  2. 转码:ffmpeg 转为 audio/ogg(opus 编码,16k 单声道)
  3. 获取 tenant token:飞书 /auth/v3/tenant_access_token/internal
  4. 上传语音文件:飞书 /im/v1/files,拿 file_key
  5. 发送 audio 消息:飞书 /im/v1/messagesmsg_type=audio + file_key

成功时脚本输出:

{"success": true, "message_id": "...", "file_key": "..."}

Requirements

  • ffmpeg 可用
  • edge-tts 可用(脚本自动尝试以下入口):
    • edge-tts
    • ~/Library/Python/3.14/bin/edge-tts
    • python3 -m edge_tts
  • 本机存在 OpenClaw 配置:~/.openclaw/openclaw.json
    • 默认读取:channels.feishu.accounts.feishu-main.appId/appSecret

Failure Handling

  • 缺少依赖:按报错安装(例如 python3 -m pip install --user edge-tts
  • 飞书 API 失败:脚本会直接输出原始 JSON 错误,按 code/msg 排查
  • 被降级成文本:确认发送的是 msg_type=audiocontent 里是上传后的 file_key

scripts/

  • scripts/send_feishu_voice.sh:完整自动化脚本(TTS + 转码 + 上传 + 发送)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Session-Memory Enhanced

Session-Memory Enhanced v4.0 - 统一增强版。融合 session-memory + memu-engine 核心功能。特性:结构化提取 + 向量检索 + 不可变分片 + 三位一体自动化 + 多代理隔离 + AI 摘要 + 零配置启动。

Registry SourceRecently Updated
General

PRISM-GEN-DEMO

English: Retrieve, filter, sort, merge, and visualize multiple CSV result files from PRISM-Gen molecular generation/screening. Provides portable query-based...

Registry SourceRecently Updated
General

Video Pro by cza999

专业AI视频生成器,支持文本转高质量短视频,批量处理、多模板和高级自定义语音功能,适合创作者和企业。

Registry SourceRecently Updated
0133
cza999