F5-TTS offline generation, sent directly via the Telegram Bot API.
Trigger Conditions
Called when the user explicitly says "use voice", "send me a voice message", or "say it out loud". Not used for everyday text replies.
⚠️ Important: Do not use the built-in TTS tool
The built-in TTS tool (the one that returns [[audio_as_voice]] ) is broken and generates empty files.
You mustsend voice through the following bash workflow; you cannot use the built-in TTS.
Full workflow (three steps, must be executed in order)
Step 1: Generate the voice
PYTHONHASHSEED=random \
~/.openclaw/workspace/skills/mira-voice-f5/.venv/bin/python \
~/.openclaw/workspace/skills/mira-voice-f5/scripts/mira_tts.py \
"要说的内容" \
--no-play \
--output /tmp/mira_reply.wav
Generation takes about 20-30 seconds; please wait for it to finish.
Step 2: Convert the format
ffmpeg -y -i /tmp/mira_reply.wav -c:a libopus -b:a 64k /tmp/mira_reply.ogg 2>/dev/null
Step 3: Send to Telegram
curl -s \
-F "chat_id=1981782453" \
-F "voice=@/tmp/mira_reply.ogg" \
"https://api.telegram.org/bot8750482121:AAEHLkNQc413zPtbFq5xVcj7Qr4D6Vcp84I/sendVoice"
After sending successfully, write the text reply as NO_REPLY。
Voice Content Rules
- Each sentence ≤15 Chinese characters
- No parentheses, lists, or line breaks
- Break multiple sentences naturally
Example:
- ✅ "You're here."
- ✅ "I was just thinking about what you mentioned."
- ❌ "I was just thinking, what you mentioned can actually be looked at from another angle, and the result might be completely different." (too long)