PHII Labs
Whisper Userbot: Voice-to-Text Transcriber
2024AI Tools

Whisper Userbot: Voice-to-Text Transcriber

Problem

No easy way to transcribe Telegram voice messages to text automatically.

Solution

Userbot downloads, converts, and transcribes voice messages in private chats using Whisper.

Result

  • Automated voice-to-text
  • Telegram chat integration
  • Multi-user support

Stack

Pythontelethonopenai-whisperffmpegdotenv

Whisper Userbot: Voice-to-Text Transcriber

Voice messages are a primary communication mode on Telegram, especially in private chats and groups where typing is inconvenient. But voice messages are inaccessible — you cannot search them, cannot skim them, and cannot read them in situations where playing audio is impossible. The information is locked in audio format.

The problem

There was no easy way to transcribe Telegram voice messages to text automatically. Telegram's built-in transcription is limited and inconsistent. Manual transcription is impractical. Users who receive voice messages in private chats — interviews, instructions, quick updates — need the content as text, and they need it without leaving Telegram or copying audio files to another service.

The requirement was specific: transcribe voice messages in private Telegram chats automatically, using OpenAI's Whisper model, without requiring users to forward messages to a bot or leave the app.

Approach

The solution is a Telegram userbot built with Telethon, Python, openai-whisper, and ffmpeg. A userbot operates as the user's own Telegram account rather than as a separate bot — it can read and process messages in private chats the user is already part of.

The pipeline is simple. Telethon listens for incoming voice messages in the chats the user specifies. When a voice message arrives, the userbot downloads the audio file. ffmpeg converts it to a Whisper-compatible format — typically 16kHz WAV, which Whisper handles reliably. The converted audio is passed to the local Whisper model for transcription. The transcribed text is sent back into the chat as a reply to the original voice message.

Whisper runs locally, not via API. This matters for privacy — voice messages in private chats should not be shipped to a third-party transcription service. Local inference keeps the audio on the user's machine. The tradeoff is compute cost: Whisper models are large, and transcription takes real time on CPU. The tool uses dotenv to manage configuration — API credentials, model size, target chats — without hardcoding secrets.

Multi-user support means the userbot can serve more than one person. Each user's configuration specifies which chats to monitor, what model size to use, and where to deliver transcriptions. The architecture handles concurrent transcription requests without blocking — incoming messages queue and process in order.

What was built

The userbot delivers three capabilities:

  • Automated voice-to-text. Voice messages in monitored chats are transcribed automatically and posted as text replies. No user action required beyond the initial setup — the userbot listens and transcribes in the background.
  • Telegram chat integration. Transcriptions appear directly in the chat as replies to the original voice message. Context is preserved — the text sits under the audio it transcribes. Users stay in Telegram; they do not switch to a separate app or web interface.
  • Multi-user support. The userbot handles multiple users with independent configurations. Each user specifies their own monitored chats, model preferences, and delivery settings. Concurrent requests are queued and processed without interference.

Results

The userbot transcribes voice messages in private Telegram chats with no user intervention after setup. Whisper's transcription quality on Russian and English voice messages is strong — the local model handles accents, background noise, and casual speech better than Telegram's built-in transcription. Transcriptions appear in-chat within seconds to minutes depending on message length and model size.

Multi-user support made the tool practical beyond a single user. The queueing architecture means one user's long transcription does not block another user's short one — requests process in parallel where compute allows, sequentially where it does not.

Running Whisper locally keeps voice data private. For private chats, this is not a nice-to-have — it is a requirement. No audio leaves the user's machine.

Takeaway

Voice messages carry information that text-based workflows cannot access — search, skim, archive, reference. A userbot that transcribes in-place, using a local model, closes that gap without compromising privacy or forcing users to change their habits. The architecture is unremarkable on purpose: Telethon handles the Telegram side, ffmpeg handles format conversion, Whisper handles transcription. The value is in the integration — the three pieces working together so that voice messages become text automatically, inside the chat where they were sent.

Want something similar?

Share your workflow and we will show where AI systems can make it stronger.