HomeBlog → Voice message transcription: Telegram, WhatsApp and other messengers

Voice message transcription: Telegram, WhatsApp and other messengers

Published 2026-08-05 · 5 min read

Voice messages are convenient for the sender and inconvenient for everybody else: you cannot skim them, search them or read them in a meeting. Automatic transcription fixes that — here is how to wire it into a bot or a business process.

How voice messages differ from ordinary recordings

Three properties matter here:

Sending a voice message for transcription

The file goes exactly as the messenger delivered it:

from openai import OpenAI

client = OpenAI(base_url="https://voicesscribe.com/v1", api_key="your key")

with open("voice_message.ogg", "rb") as f:
    text = client.audio.transcriptions.create(model="whisper-1", file=f).text

print(text)

The format is detected from the contents of the file rather than from its extension, so a wrong file name will not break recognition.

A bot that answers a voice message with text

The flow is simple: receive the voice message, download the file, send it for transcription, post the text back to the chat.

async def on_voice(message, bot):
    file = await bot.download(message.voice.file_id)   # ogg/opus
    text = client.audio.transcriptions.create(
        model="whisper-1", file=("voice.ogg", file), language="en",
    ).text
    await message.reply(text or "Could not make out any speech")

The answer comes back in the same request, so the user gets the text a couple of seconds after sending the message.

Short clips: how to raise accuracy

Two- and three-second recordings are the hard case: there is little context and language detection can slip. Three techniques that almost always help:

  1. State the language explicitlylanguage="en". Auto-detection is switched off and the errors on short phrases disappear.
  2. Describe the expected content through prompt. For confirmation codes: prompt="A four-digit confirmation code".
  3. Check the confidence. The verbose_json response carries the language probability: a low value is a signal to review that message.

Multilingual streams

If messages arrive in different languages, there is nothing to configure: the language is detected from the audio and 99 languages are supported. The verbose_json response returns the detected language, which is a convenient way to route conversations between agents.

One caveat: the language is decided from the beginning of the recording. If somebody starts in English and switches to Spanish, the transcript continues in “English mode” — those messages are better handled separately.

Silence and empty recordings

Some voice messages turn out to be empty: an accidental tap, a dropped connection, background noise with no speech. In those cases the service returns an empty string rather than invented sentences — built-in filters cut the typical neural-network hallucinations such as closing credits and “thanks for watching”.

In code it is enough to check for an empty string and not show the user a meaningless answer.

Try it on your own recordings. Sign-up takes a minute, and the free minutes are enough to judge the quality.

Get a free API key

Frequently asked questions

Do I have to convert ogg to wav before sending?

No. The file is accepted in whatever format the messenger produced: ogg, opus, mp3, m4a, wav and other common formats.

Which languages work best for voice messages?

English, Spanish, German and other widely spoken languages are recognised with the highest quality, and 99 languages are supported in total. For a single-language stream it is still better to state the language explicitly.

How long does a voice message take to transcribe?

A usual message of up to a minute is processed in one or two seconds, and the answer is returned in the same request.

What comes back if there is no speech in the recording?

An empty text. The service does not invent content where there is none.

Is there a file size limit?

Yes, 25 MB per request. For voice messages that is a huge margin: in opus, that size is several hours of speech.

Related reading