← 返回 Skills 市场
zihui

Feishu Voice (macOS)

作者 zihui · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
241
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install feishu-macos-voice
功能描述
Send voice/audio messages to Feishu (Lark) chats using TTS. Automatically uses OpenAI TTS (gpt-4o-mini-tts) if OPENAI_API_KEY is set, otherwise falls back to...
使用说明 (SKILL.md)

Feishu Voice Message

Send voice messages to Feishu (Lark) via TTS → opus → Feishu API.

TTS Engine Priority

Priority Engine Condition
1st OpenAI TTS (gpt-4o-mini-tts) OPENAI_API_KEY env var is set
2nd macOS say (fallback) No OPENAI_API_KEY

Prerequisites

  • ffmpeg with libopus: brew install ffmpeg
  • Feishu bot app_id + app_secret — read from ~/.openclaw/openclaw.jsonchannels.feishu
  • OpenAI TTS (optional): OPENAI_API_KEY environment variable

Quick Send

scripts/feishu-voice.sh \x3Ctext> \x3Creceive_id> [receive_id_type] [voice] [openai_instructions]

Examples:

# Auto-selects engine based on OPENAI_API_KEY
scripts/feishu-voice.sh "今天天气不错!" ou_xxxxxxxx open_id

# OpenAI TTS with Taiwan accent instructions
scripts/feishu-voice.sh "你好!" ou_xxxxxxxx open_id shimmer "Speak with a Taiwan Mandarin accent"

# macOS TTS with specific voice (when no OPENAI_API_KEY)
scripts/feishu-voice.sh "会议提醒" oc_xxxxxxxx chat_id Meijia

# Send to a group
scripts/feishu-voice.sh "下午三点开会" oc_xxxxxxxx chat_id

Voice Options

OpenAI TTS voices

Voice Character
shimmer Warm, expressive (recommended for Chinese)
nova Friendly, natural
alloy Neutral
echo Clear
fable Expressive
onyx Deep

Use openai_instructions (5th arg) for accent/style control, e.g.:

  • "Speak with a Taiwan Mandarin accent"
  • "Use a warm and friendly tone"

macOS say voices (fallback)

Voice Language Notes
Tingting 普通话 zh_CN Recommended default
Meijia 台湾 zh_TW Taiwan accent
Sinji 粤语 zh_HK Cantonese

List all: say -v '?'

Manual Step-by-Step

1. Get credentials

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

2a. TTS → mp3 (OpenAI)

curl -s -X POST "https://api.openai.com/v1/audio/speech" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini-tts","input":"要说的文字","voice":"shimmer","response_format":"mp3"}' \
  -o /tmp/voice.mp3

2b. TTS → AIFF (macOS fallback)

say -v "Tingting" "要说的文字" -o /tmp/voice.aiff

3. Transcode to opus ⚠️ All three flags required

# From mp3 (OpenAI)
ffmpeg -y -i /tmp/voice.mp3 -acodec libopus -ac 1 -ar 16000 /tmp/voice.opus

# From aiff (macOS)
ffmpeg -y -i /tmp/voice.aiff -acodec libopus -ac 1 -ar 16000 /tmp/voice.opus
Flag Value Why
-acodec libopus opus codec Feishu only accepts opus
-ac 1 mono Required by Feishu
-ar 16000 16 kHz Required by Feishu

4. Get duration in milliseconds

DURATION_MS=$(ffprobe -v quiet -show_entries format=duration -of csv=p=0 /tmp/voice.opus \
  | python3 -c "import sys; print(round(float(sys.stdin.read().strip()) * 1000))")

⚠️ duration param is milliseconds, not seconds. Wrong unit → 0s display.

5. Get tenant_access_token

TENANT_TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['tenant_access_token'])")

6. Upload file

FILE_KEY=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
  -H "Authorization: Bearer $TENANT_TOKEN" \
  -F "file_type=opus" \
  -F "file_name=voice.opus" \
  -F "duration=$DURATION_MS" \
  -F "file=@/tmp/voice.opus" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['file_key'])")

⚠️ file_type must be opus, not audio.

7. Send audio message

curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=open_id" \
  -H "Authorization: Bearer $TENANT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$RECEIVE_ID\",\"msg_type\":\"audio\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}"

Common Issues

Symptom Cause Fix
Duration shows 0s duration unit is seconds, not ms Multiply by 1000
Upload fails 400 file_type=audio used Change to opus
Silent/tiny AIFF Voice pack not installed System Settings → Accessibility → Spoken Content → download voice
Garbled audio Missing -ac 1 -ar 16000 Add both ffmpeg flags
OpenAI 401 error OPENAI_API_KEY invalid or not set Check env var; falls back to macOS say
安全使用建议
This skill appears to do exactly what it claims: generate TTS (via OpenAI or macOS), transcode to opus, and send it to Feishu using your Feishu bot credentials stored at ~/.openclaw/openclaw.json. Before installing or using it: (1) verify that your ~/.openclaw/openclaw.json contains only the expected Feishu app_id/app_secret and is stored securely, because the script will read those secrets; (2) if you enable OPENAI_API_KEY, be aware usage will call OpenAI's API (and may incur costs); (3) inspect the included scripts yourself (they are small and readable) and run a manual test to confirm behavior; (4) ensure ffmpeg/ffprobe are installed from trusted sources since they process audio; (5) if you have concerns about automatic network calls, only run the script locally or in an environment where you can monitor outbound connections. Note: the registry summary showed a minor metadata formatting oddity ('Required config paths: [object Object]') but the SKILL.md and script clearly specify the config path used.
功能分析
Type: OpenClaw Skill Name: feishu-macos-voice Version: 1.1.0 The skill provides a legitimate utility for sending voice messages to Feishu (Lark) using either OpenAI TTS or the macOS native `say` command. It correctly retrieves credentials from the expected local configuration file (`~/.openclaw/openclaw.json`) and communicates only with official endpoints (api.openai.com and open.feishu.cn). The implementation in `scripts/feishu-voice.sh` uses safe practices, such as passing shell variables to Python via `sys.argv` to prevent injection when constructing JSON payloads.
能力评估
Purpose & Capability
The name/description (send voice messages to Feishu using TTS) matches the files and runtime requirements. The script needs ffmpeg/ffprobe/curl/python3 and Feishu app_id/app_secret to obtain a tenant token and upload/send audio — all expected for this feature. The SKILL.md and script both reference the same Feishu endpoints and optional OPENAI_API_KEY.
Instruction Scope
Runtime instructions and the script only perform TTS (OpenAI or macOS say), transcode to opus, obtain a tenant_access_token using app_id/app_secret from ~/.openclaw/openclaw.json, upload the opus file, and send the audio message. There are no instructions to read unrelated files, escalate privileges, or exfiltrate arbitrary data beyond the Feishu/OpenAI network calls required for operation.
Install Mechanism
This is instruction-only plus a small shell script — there is no installer that downloads and executes remote archives. It depends on existing local binaries (ffmpeg, ffprobe, curl, python3, and optionally macOS 'say'). That is low risk and proportionate to the task.
Credentials
No required environment variables are declared; OPENAI_API_KEY is optional and only used to call OpenAI TTS. The skill reads sensitive Feishu credentials (app_id/app_secret) from ~/.openclaw/openclaw.json — this is necessary for the Feishu API but you should be aware the script reads those secrets directly. The number and type of credentials requested are proportional to the stated functionality.
Persistence & Privilege
The skill is not always-enabled and does not request elevated or persistent system privileges. It does not modify other skills or system-wide settings; it writes temporary files to /tmp and cleans them up. Autonomous invocation is allowed (platform default) but not unusually privileged here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-macos-voice
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-macos-voice 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Dual TTS engine: OpenAI TTS (gpt-4o-mini-tts) when OPENAI_API_KEY is set, macOS say as fallback. Supports openai_instructions for accent/style control.
v1.0.2
Declare required binaries (say, ffmpeg, ffprobe, curl, python3) and config path (~/.openclaw/openclaw.json) in metadata for security scan transparency
v1.0.1
Remove personal name from example
v1.0.0
Send TTS voice messages to Feishu/Lark using macOS built-in 'say' command. Zero external dependencies — no API key needed for TTS. Correct opus encoding flags (-ac 1 -ar 16000) and millisecond duration param.
元数据
Slug feishu-macos-voice
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Feishu Voice (macOS) 是什么?

Send voice/audio messages to Feishu (Lark) chats using TTS. Automatically uses OpenAI TTS (gpt-4o-mini-tts) if OPENAI_API_KEY is set, otherwise falls back to... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 241 次。

如何安装 Feishu Voice (macOS)?

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

Feishu Voice (macOS) 是免费的吗?

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

Feishu Voice (macOS) 支持哪些平台?

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

谁开发了 Feishu Voice (macOS)?

由 zihui(@zihui)开发并维护,当前版本 v1.1.0。

💬 留言讨论