Create Feishu replies that contain both normal text and a real voice bubble/player. Avoid sending raw mp3 files when the goal is in-chat playback.
Draft the text reply first.
Keep the visible text and the spoken text aligned.
Use scripts/build_feishu_voice.py to synthesize Chinese speech with Edge TTS and convert it to Ogg/Opus through ffmpeg.
Send the text reply normally.
Send the generated .ogg file with the messaging tool as a voice message:
mimeType: audio/oggasVoice: trueIf a message id is available, reply to the triggering message for both the text and the voice.
zh-CN-XiaoxiaoNeural/root/.openclaw/workspace/temp/voice/ 目录,不要用 /tmp。否则飞书只显示文件路径而不是语音播放条。
<<<<<<< HEAD#8d2abf78b8490403831aae82052e8e107054b856
Run:
bash
python3 scripts/build_feishu_voice.py \
--text "今天上海多云,气温十一度。" \
--out-dir /root/.openclaw/workspace/temp/voice
The script prints JSON including:
ogg_path: send this to Feishu as the voice file (必须在 Workspace 下)mp3_path: intermediate filevoice: selected Edge TTS voiceAfter building the file:
Send the visible text reply.
Send ogg_path with:
feishupath = generated ogg_pathmimeType = audio/oggasVoice = truescripts/build_feishu_voice.py: deterministic synthesis + ffmpeg conversion for Feishu voice playback.