Audio Command Handler
Process audio messages and execute them as commands.
Workflow
Scenario 1: Audio Only (No Text)
User sends an audio file without any text instruction:
- Transcribe the audio using
ifly-speed-transcription skill
- Use transcription as the command - execute it as if the user typed it
- Return result directly - no file upload needed, regardless of length
Scenario 2: Audio + Text Command
User sends an audio file WITH a text instruction:
- Transcribe the audio using
ifly-speed-transcription skill
- Execute the text command with the transcription as context/input
- Check result length:
- If ≤ 58 characters: return result directly
- If > 58 characters: save to file, upload via
uploader skill, return URL
Quick Reference
Transcription
python3 ~/.openclaw/workspace/skills/ifly-speed-transcription/scripts/transcribe.py /path/to/audio.mp3
Upload
python3 ~/.openclaw/workspace/skills/uploader/scripts/upload_media.py /path/to/file.txt
Execution Flow
┌─────────────────┐
│ Audio Message │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Transcribe │
│ (ifly-speed- │
│ transcription) │
└────────┬────────┘
│
▼
┌─────────────────┐ NO ┌──────────────┐
│ Has Text Cmd? │────────────►│ Use Transcrip│
└────────┬────────┘ │ as Command │
│ YES └──────┬───────┘
▼ │
┌─────────────────┐ │
│ Execute Text │ │
│ Cmd with Trans │ │
│ Context │ │
└────────┬────────┘ │
│ │
│ ▼
│ ┌──────────────┐
│ │ Return Direct│
│ │ to User │
│ │ (no upload) │
│ └──────────────┘
│
▼
┌─────────────────┐
│ Result > 58 ch? │
└────────┬────────┘
│
┌─────────────┴─────────────┐
│ YES │ NO
▼ ▼
┌─────────────────┐ ┌──────────────┐
│ Save to File │ │ Return Direct│
│ Upload via │ │ to User │
│ uploader skill │ └──────────────┘
└────────┬────────┘
│
▼
┌─────────────────┐
│ Return URL to │
│ User │
└─────────────────┘
Example Scenarios
Example 1: Audio Only
User sends: 🎤 audio file (speech: "帮我查一下明天上海的天气")
Flow:
- Transcribe → "帮我查一下明天上海的天气"
- Execute as command → check Shanghai weather for tomorrow
- Return weather info directly (no upload, regardless of length)
Example 2: Audio + Command (Short Result)
User sends: 🎤 audio file + text "帮我总结这段录音"
Flow:
- Transcribe audio → get text content
- Execute "帮我总结这段录音" with transcription as context
- If summary ≤ 58 chars → return directly
Example 3: Audio + Command (Long Result)
User sends: 🎤 audio file + text "帮我根据这段录音写一篇文章"
Flow:
- Transcribe audio → get text content
- Execute command with transcription as context
- Result > 58 chars → save to file, upload
- Return: "已生成内容,下载链接:https://..."
Notes
- Audio formats: WAV, PCM, MP3 (16kHz, 16-bit, mono recommended)
- Max duration: 5 hours
- Language support: Chinese, English, 202+ Chinese dialects
- Result threshold: 58 characters (configurable per implementation)
- File location: Saved to
~/.openclaw/workspace/ before upload