---
title: "Transcribe WhatsApp voice notes (.ogg) with an API | BroadRouter"
description: "Convert WhatsApp .ogg voice notes or .m4a phone recordings to WAV with ffmpeg and transcribe them in Arabic or 13 other languages with one API call."
url: https://broadrouter.com/guides/transcribe-whatsapp-voice-notes/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Transcribe WhatsApp voice notes to text with an API

Updated 2026-11-16

WhatsApp voice notes are Opus audio in .ogg files, which the transcription endpoint does not accept directly. Convert each one to 16 kHz mono WAV with ffmpeg, then send it to BroadNet Transcribe Arabic or BroadNet Transcribe with the right language field. A short script does both for a whole folder.

Export the voice notes from the chat (or receive them through your WhatsApp Business integration) and you’ll have `.ogg` files. Meta’s Cloud API docs say WhatsApp voice messages are `.ogg` files encoded with the Opus codec. Phone recordings are often `.m4a`. BroadNet’s transcription endpoint accepts WAV and MP3, so convert first.

## 1\. Convert one file

```bash
ffmpeg -i voice-note.ogg -ar 16000 -ac 1 voice-note.wav
```

`-ar 16000 -ac 1` makes 16 kHz mono audio, the conversion BroadNet’s docs use for voice notes and phone recordings. The same command works for `.m4a`. 16 kHz mono 16-bit WAV is 32,000 bytes a second, so the 26,214,400-byte file cap holds about 13 minutes. For longer recordings, the [audio splitter](https://broadrouter.com/tools/audio-splitter-ffmpeg/) works out how many chunks you need and writes the ffmpeg commands.

## 2\. Transcribe a whole folder

```python
import os, pathlib, subprocess
from openai import OpenAI

client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])

for src in sorted(pathlib.Path("voice-notes").glob("*.ogg")):
    wav = src.with_suffix(".wav")
    subprocess.run(["ffmpeg", "-y", "-loglevel", "error", "-i", str(src), "-ar", "16000", "-ac", "1", str(wav)], check=True)
    with open(wav, "rb") as audio:
        text = client.audio.transcriptions.create(
            model="broadnet/cohere-transcribe-arabic",
            file=audio,
            language="ar",          # use "en", "es", ... with broadnet/cohere-transcribe
        ).text
    src.with_suffix(".txt").write_text(text, encoding="utf-8")
    print(src.name, "->", text[:60])
```

Each `.txt` lands next to its voice note. To run the same steps automatically on every incoming WhatsApp Business message, see the [n8n WhatsApp voice note workflow](https://broadrouter.com/guides/n8n-whatsapp-voice-note-transcription/).

## Cost

A one-minute voice note costs $0.0042 in Arabic or $0.002 with the 14-language model. Audio and transcripts are not retained after the request; see [zero data retention](https://broadrouter.com/zero-data-retention/).

## Troubleshooting

-   **Latin letters instead of Arabic:** add `language="ar"`. BroadNet’s docs say to always send `language`.
    
-   **413 error:** the file is over 26,214,400 bytes (25 MiB). Split long recordings into 10-minute WAV pieces:
    
    ```bash
    ffmpeg -i long-note.ogg -ar 16000 -ac 1 -f segment -segment_time 600 part-%03d.wav
    ```
    
-   **400 or 422 on the upload:** check the file really is WAV or MP3 and not an `.ogg` renamed to `.wav`. Run the ffmpeg conversion.
    
-   **`ffmpeg: command not found`:** install ffmpeg from your package manager (for example `apt install ffmpeg` or `brew install ffmpeg`).
    
-   **429 error:** pay-as-you-go keys allow 4 requests at once; process files in a small pool. See [all BroadNet error codes](https://broadrouter.com/guides/errors-and-retries/).
    

More detail on the model, formats and accuracy: [the Arabic speech-to-text guide](https://broadrouter.com/guides/arabic-speech-to-text-api/). To compare what other providers charge per audio minute, see the open [speech-to-text API price index](https://broadrouter.com/data/speech-to-text-api-prices/), with a source and date for every price. For background on why 16 kHz is enough for speech, see [sample rate](https://broadrouter.com/glossary/sample-rate/).

## Terms in this guide

[WAV](https://broadrouter.com/glossary/wav/)

WAV (Waveform Audio File Format, or WAVE) is an audio container built on Microsoft and IBM's RIFF format. It usually holds uncompressed linear PCM samples, so its size is predictable: sample rate times bytes per sample times channels, per second.

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[Speech-to-text](https://broadrouter.com/glossary/speech-to-text/)

Speech-to-text, also called automatic speech recognition (ASR), is technology that converts spoken audio into written text. A speech-to-text API accepts an audio file or stream and returns a transcript, usually priced per minute of audio. Accuracy is measured with word error rate and varies with accent, dialect and recording quality.

[Concurrency](https://broadrouter.com/glossary/concurrency/)

Concurrency is the number of requests a client has in flight at the same time. LLM APIs often cap it per key or plan, separately from requests per minute, because each open request holds GPU capacity until its response has finished.

[Ogg Opus](https://broadrouter.com/glossary/ogg-opus/)

Ogg Opus is audio encoded with the Opus codec (RFC 6716) and stored in an Ogg container (RFC 7845). It is built for speech and interactive audio at low bitrates, and it is the format WhatsApp uses for voice notes, usually as .ogg or .opus files.

[Sample rate](https://broadrouter.com/glossary/sample-rate/)

Sample rate is the number of audio samples captured per second, measured in hertz (Hz). Speech recognition models commonly expect 16,000 Hz (16 kHz) mono audio. Together with bit depth and channel count, the sample rate sets how large an uncompressed audio file is per minute.

[Tool calling](https://broadrouter.com/glossary/tool-calling/)

Tool calling, also called function calling, is an LLM API feature in which the model returns a structured request to run a function the developer has defined, with JSON arguments. The application runs the function and sends the result back; the model never runs code itself.

[Zero data retention](https://broadrouter.com/glossary/zero-data-retention/)

Zero data retention (ZDR) is a data-handling policy in which an AI provider processes prompts and outputs only to serve a request and does not store that content afterward, in logs, caches or training data. Content-free records such as token counts and timings are usually still kept.

## Questions

### What audio format are WhatsApp voice notes?

Opus audio in an Ogg container, saved as .ogg. Meta's Cloud API docs say voice messages must be .ogg files encoded with the Opus codec, mono only.

### Can I send the .ogg file straight to the transcription API?

Not to BroadNet Inference. Its transcription endpoint accepts WAV and MP3, so convert the voice note with ffmpeg first. One command turns it into 16 kHz mono WAV.

### Are the voice notes stored after transcription?

BroadNet says audio and transcripts are processed for the request and not retained. It keeps only content-free records such as timings, status and usage for billing and security.

### Which model should I use for Arabic voice notes?

BroadNet Transcribe Arabic, broadnet/cohere-transcribe-arabic, with language set to ar. Use BroadNet Transcribe, broadnet/cohere-transcribe, for the other 13 languages it covers.

## Related guides

-   [Transcribe WhatsApp voice notes in n8n](https://broadrouter.com/guides/n8n-whatsapp-voice-note-transcription/)
-   [Arabic speech-to-text API, step by step](https://broadrouter.com/guides/arabic-speech-to-text-api/)
-   [BroadNet Inference error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-transcribe-whatsapp-voice-notes&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference API reference, transcription and ffmpeg conversion](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-transcribe-whatsapp-voice-notes&utm_content=sources#requests)
-   [BroadNet Inference pricing](https://inference.broadnet.ai/pricing?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-transcribe-whatsapp-voice-notes&utm_content=sources)
-   [Meta WhatsApp Cloud API, audio messages (voice messages are OGG with the Opus codec; checked 2026-11-14)](https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/audio-messages)
-   [FFmpeg formats documentation, segment muxer (checked 2026-11-14)](https://ffmpeg.org/ffmpeg-formats.html#segment)
