Download a WhatsApp voice note and you get a small .ogg file. Inside is Opus audio, a codec designed for voice calls.
How it works
There are two layers, each defined by an IETF RFC:
| Layer | Spec | What it does |
|---|---|---|
| Opus codec | RFC 6716 | Compresses the audio. It combines a linear-prediction layer based on SILK with an MDCT layer based on CELT, and runs from 6 kbit/s narrowband speech up to 510 kbit/s stereo music |
| Ogg container | RFC 7845 | Wraps the Opus packets in a file, starting with an OpusHead identification header |
RFC 6716 lists five bandwidths, from narrowband (8 kHz sample rate) to fullband (48 kHz). RFC 7845 says granule positions always count samples at 48 kHz, whatever rate the decoder outputs. It recommends the .opus extension and the audio/ogg media type, optionally audio/ogg; codecs=opus.
Meta’s WhatsApp Cloud API media reference lists OGG audio as audio/ogg with “Opus codec only”, mono, up to 16 MB.
Why it matters
- Many APIs will not take it. A speech-to-text endpoint that accepts only WAV or MP3 rejects a voice note until you convert it.
- Conversion is cheap. One ffmpeg command decodes Opus to PCM. The result is much larger than the voice note, so watch file-size caps.
- Name confusion. “Opus” is also a model name at other providers. In audio contexts it means the codec.
On BroadNet Inference
BroadNet’s transcription endpoint accepts WAV (audio/wav) or MP3 (audio/mpeg) only, up to 26,214,400 bytes per file. Its docs convert a WhatsApp voice note in one step:
ffmpeg -i voice-note.ogg -ar 16000 -ac 1 voice-note.wav
-ar sets the audio sampling frequency and -ac the number of channels, per the ffmpeg documentation, so this writes 16 kHz mono WAV. Then send it with language=ar (or en) to BroadNet Transcribe Arabic or BroadNet Transcribe. The WhatsApp voice notes guide has a script that converts and transcribes a whole folder, and the n8n guide does it inside a workflow. For a voice note too long for one file, the audio splitter works out the chunks.
Common mistakes
- Renaming instead of converting. Changing
.oggto.wavdoes not change the audio inside. Decode with ffmpeg. - Skipping
-ac 1. Stereo doubles the WAV size without helping transcription.