Install
openclaw skills install feishu-voice-api-sender飞书语音消息发送:使用官方 API 上传 OPUS 音频并发送语音消息,解决 OpenClaw 内置发送缺少 duration 参数的问题。| Send voice messages via Feishu official API, fixing OpenClaw's missing duration parameter bug.
openclaw skills install feishu-voice-api-sender通过飞书官方 API 发送语音消息,解决 OpenClaw 内置发送缺少 duration 参数的问题。
OpenClaw 内置的飞书媒体发送存在 bug:
uploadFileFeishu 缺少 duration 参数sendFileFeishu 发送 audio 消息时 content 缺少 duration飞书官方 API 要求:
duration(毫秒)file_key 和 duration本 skill 直接调用飞书官方 API,绕过 OpenClaw 内置函数的 bug。
python3 /mnt/d/wslspace/workspace/skills/feishu-voice-send/scripts/send_voice.py <音频文件路径> <接收者open_id>
python3 /mnt/d/wslspace/workspace/skills/feishu-voice-send/scripts/tts_and_send.py "要转换的文字" <接收者open_id>
直接发送现有的 .ogg 音频文件:
python3 scripts/send_voice.py <ogg文件路径> <open_id>
python3 scripts/tts_and_send.py "文字内容" <open_id> [-v voice] [-r rate]
参数:
文字内容(必须):要转换的文字open_id(必须):接收者飞书 open_id-v voice:TTS 音色,默认 zh-CN-YunjianNeural-r rate:语速,默认 -10%(即90%速度)python3 scripts/send_voice.py /path/to/audio.ogg <接收者open_id>
python3 scripts/tts_and_send.py "你好,这是语音测试。" <接收者open_id>
python3 scripts/tts_and_send.py "Hello world" <接收者open_id> -v en-US-EmmaNeural -r 0
OpenClaw 内置的飞书媒体发送存在 bug:
uploadFileFeishu 缺少 duration 参数sendFileFeishu 发送 audio 消息时 content 缺少 duration飞书官方 API 要求:
duration(毫秒)file_key 和 duration直接调用飞书官方 API,不走 OpenClaw 内置函数:
脚本从以下途径获取飞书凭证(优先级从高到低):
设置环境变量,最灵活:
# 在终端中设置
export APP_ID="cli_xxxxxxxxxxxxxx"
export APP_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"
# 或直接运行
APP_ID="cli_xxxxxxxxxxxxxx" APP_SECRET="xxxxxxxx" python3 scripts/send_voice.py ...
如果脚本在 OpenClaw 环境下运行,会自动从 ~/.openclaw/openclaw.json 读取 main 账号的凭证。
如果以上方式都不适用,可以直接在脚本开头修改:
APP_ID = "cli_xxxxxxxxxxxxxx"
APP_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxx"
注意:方式三会随 skill 更新丢失,不推荐。
App ID 和 App Secretim:message 相关权限)