← Back to Skills Marketplace
zihui

Feishu Voice (macOS)

by zihui · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
241
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install feishu-macos-voice
Description
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...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-macos-voice
  3. After installation, invoke the skill by name or use /feishu-macos-voice
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug feishu-macos-voice
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 241 downloads so far.

How do I install Feishu Voice (macOS)?

Run "/install feishu-macos-voice" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Voice (macOS) free?

Yes, Feishu Voice (macOS) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Voice (macOS) support?

Feishu Voice (macOS) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Feishu Voice (macOS)?

It is built and maintained by zihui (@zihui); the current version is v1.1.0.

💬 Comments