Telegram Voice → Text (STT)#
When a user sends a voice note on Telegram, OpenClaw transcribes it before the model runs.
How it works#
- Telegram delivers
.ogg voice file to .openclaw/media/inbound/
- Gateway runs
transcribe-audio-cli.js (Google Cloud Speech-to-Text)
- Transcript replaces
<media:audio> in the user message
- Optional echo: user sees
📝 Heard: "..." in Telegram
- Assistant answers the transcribed text via Bifrost → genapp-proxy → Dialogflow
Rules for the assistant#
- Never say "I cannot process audio" if a transcript is present
- Reply to the transcript content as the user's actual question
- For Hindi/English mix, answer in the language the user spoke or ask which they prefer
- If transcription is empty, ask the user to type their message or re-record
Stack#
- OpenClaw:
tools.media.audio CLI model → ~/.openclaw/gcp/transcribe-audio-cli.js
- Fallback: genapp-proxy also transcribes voice before Dialogflow (8192 token limit)
Manual test (gateway machine)#
powershell
node "$env:USERPROFILE\.openclaw\gcp\transcribe-audio-cli.js" "C:\path\to\voice.ogg"