Most pages that rank for “translate Arabic audio to English” are upload-and-download web tools. They are fine for one file. If you need translation inside your own product (support calls, interviews, voice notes, lectures), you need two API calls and some checks around them. This post builds that pipeline on one OpenAI-compatible key, tests it, and shows how to measure whether it is good enough.
For translating Arabic text you already have, see Arabic–English translation with LLMs. For turning a meeting recording into minutes rather than a full translation, see Arabic meeting minutes from recordings.
One call or two?
There are two ways to get English text from Arabic speech:
| Approach | How it works | Good for |
|---|---|---|
| Speech translation (one step) | One request; the service returns English | Live audio, captions, the simplest code |
| Transcribe, then translate (two steps) | A speech-to-text call returns Arabic text; an LLM translates it | Files, when you want the Arabic too, glossaries and checks |
The best-known one-step endpoint for files is changing. OpenAI’s speech-to-text guide says /v1/audio/translations “uses whisper-1 to translate a completed audio recording into English”. Its deprecations page, checked 2026-11-15, gives a notice date of 26 August 2026 and a shutdown date of 26 February 2027. The listed replacement is /v1/realtime/translations, which is a realtime API, not a file upload. If your code calls the old endpoint, you are re-building it either way.
Soniox is one current one-step option: its Arabic to English page shows a WebSocket request with a translation block set to source ar and target en. Live audio is where a streaming product like this makes most sense.
The two-step pipeline has three practical advantages for files:
- You keep the Arabic transcript. You can search it, show it next to the English, and re-translate it later with a better model without paying for transcription again.
- You control the translation. You pick the model, give it a glossary of names and product terms, and check its output in code.
- You can see where errors come from. A wrong English sentence is either a recognition error or a translation error. With the transcript in hand, you can tell which.
The cost is a second request and more code. The rest of this post is that code.
What does the pipeline look like?
recording (.m4a, .mp4, .ogg, .wav)
→ ffmpeg: 16 kHz mono WAV, parts of 10 minutes or less
→ transcribe each part (language=ar) → Arabic text
→ translate each part, with glossary and the end of the previous part as context
→ check numbers and empty or cut-off replies → English text
Step 1: how do you prepare and split the audio?
BroadNet’s transcription endpoint takes WAV (audio/wav) or MP3 (audio/mpeg) up to 26,214,400 bytes per file. Phone recordings (.m4a), WhatsApp voice notes (.ogg) and video need converting anyway, so resample and split in the same ffmpeg step:
ffmpeg -i interview.m4a -ar 16000 -ac 1 -c:a pcm_s16le \
-f segment -segment_time 600 chunks/part_%03d.wav
16 kHz mono 16-bit audio is 32,000 bytes a second, so a 10-minute part is about 19.2 MB, under the limit. We ran this on a 25-minute test file: it produced two parts of 19,200,162 and 19,200,194 bytes and a 5-minute part of 9,599,878 bytes.
Fixed-length cuts can split a word. For real speech, cut at silences instead; transcribe long audio files has a silence-based splitter, and the audio splitter tool writes the ffmpeg command for you. Background on sample rate and why 16 kHz is enough for speech is in the glossary.
Steps 2 and 3: how do you transcribe and translate?
The script below sends each part to the Arabic transcription model, then to a chat model with a translation prompt. It runs with the OpenAI Python SDK.
import os, re, glob
from openai import OpenAI
client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])
GLOSSARY = {"شركة النخيل": "Al Nakheel Company", "مازن": "Mazen"} # your fixed terms
SYSTEM = """You translate transcripts of spoken Arabic into clear English.
The Arabic comes from speech recognition: it may be dialect, have no punctuation,
mix in English words, and contain recognition errors.
Rules:
- Translate the meaning faithfully. Do not summarise, add or drop content.
- Keep every number, date, amount and name. Write numbers as digits.
- Use the glossary spellings exactly.
- Keep English words that the speaker used as they are.
- If a phrase makes no sense, translate it literally and add [unclear] after it.
- Reply with the English translation only."""
def glossary_block(text: str) -> str:
hits = [f"{ar} = {en}" for ar, en in GLOSSARY.items() if ar in text]
return "Glossary:\n" + "\n".join(hits) + "\n\n" if hits else ""
def transcribe(path: str) -> str:
with open(path, "rb") as audio:
return client.audio.transcriptions.create(
model="broadnet/cohere-transcribe-arabic", file=audio, language="ar").text
def translate(arabic: str, previous: str = "") -> str:
context = f"Previous part, for context only, do not translate:\n{previous}\n\n" if previous else ""
r = client.chat.completions.create(
model="broadnet/qwen3.8-27b", max_tokens=4000, reasoning_effort="low",
messages=[{"role": "system", "content": SYSTEM},
{"role": "user", "content": glossary_block(arabic) + context + "Translate:\n" + arabic}])
choice = r.choices[0]
if choice.finish_reason == "length" or not choice.message.content:
raise RuntimeError("cut off: raise max_tokens or send a shorter part")
return choice.message.content.strip()
DIGITS = str.maketrans("٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹", "01234567890123456789")
def missing_numbers(arabic: str, english: str) -> list[str]:
nums = re.findall(r"\d+", arabic.translate(DIGITS))
return [x for x in nums if x not in re.findall(r"\d+", english)]
previous = ""
for chunk in sorted(glob.glob("chunks/part_*.wav")):
arabic = transcribe(chunk)
english = translate(arabic, previous)
print(f"--- {chunk}\nAR: {arabic}\nEN: {english}")
if gaps := missing_numbers(arabic, english):
print(f"CHECK: numbers {gaps} missing from the translation")
previous = arabic[-500:]
What each piece is for:
language="ar". BroadNet’s docs say to always sendlanguagewith a transcription request. The Arabic speech-to-text guide covers the request in detail.- The prompt says where the text came from. A transcript has no punctuation, may be in dialect and may contain recognition errors. Telling the model this stops it treating odd phrases as intentional, and the
[unclear]marker gives reviewers something to search for. - Keep English words. Arabic speakers often switch to English mid-sentence (“الـ deadline”, “فريق الـ QA”). That is code-switching, and the model should leave those words alone, not translate them back and forth.
- Glossary per part. Only the glossary entries that occur in the part are sent, which keeps prompts short. The match is exact, so if your transcripts vary in spelling (أ against ا, ة against ه), normalise both sides first; the Arabic text normalizer shows the usual rules.
- Previous part as context. The last 500 characters of the previous Arabic part help with pronouns and sentences cut at a part boundary. The prompt says not to translate it, so it does not appear twice.
max_tokens=4000andreasoning_effort="low". BroadNet’s docs say DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B reason before answering and that the reasoning counts towardmax_tokens. A small limit can return an empty answer; see reasoning tokens and empty responses. The code raises an error on an empty or cut-off reply instead of saving half a translation.- Number check. Numbers are where a wrong translation does the most damage. The check maps Arabic-Indic digits (٠-٩) and Persian digits (۰-۹) to 0-9 and confirms each number appears in the English. Numbers spoken as words (“خمسة عشر”) won’t be caught, so a reviewer still reads anything that matters.
What did the test show?
We ran the script against a local mock server that implements both endpoints (no live API call). The three parts from the 25-minute test file were sent with model=broadnet/cohere-transcribe-arabic and language=ar, and each chat request carried the glossary lines for that part and the previous Arabic part as context. The mock’s third translation dropped a number on purpose, and the script printed:
--- chunks/part_002.wav
AR: اتفقنا مع شركة النخيل على تسليم ٢٤٠ وحدة قبل نهاية الشهر
EN: We agreed with Al Nakheel to deliver the units before month end.
CHECK: numbers ['240'] missing from the translation
The Arabic sentences and the company are made up for the test. The run shows that the code works, not how good any model’s translation is; for that, use the scoring step below.
How do recognition errors affect the translation?
They pass straight through. If the transcript says ٢١٤ where the speaker said ٢٤٠, the translation will faithfully say 214. If a dialect word is misheard as a similar-sounding standard word, the translation will be fluent and wrong. Fluent English makes these errors hard to spot, which is the main risk of any speech translation system.
You can measure how much of the error comes from each step. Collect 30 or more clips, and for each one get:
- a human Arabic transcript,
- a human English translation (the reference).
Then translate both the human transcript and the ASR transcript with your pipeline, and score both against the reference. chrF, a character n-gram score, copes better with names and word forms than BLEU and is the usual default for Arabic–English; SacreBLEU computes both:
from sacrebleu.metrics import BLEU, CHRF
# One English reference per clip, written by a human translator.
refs = ["We agreed with Al Nakheel Company to deliver 240 units before the end of the month.",
"The deadline is December 15, and Mazen is following up with the QA team."]
# Your pipeline's English, from the human Arabic transcript (MT only)...
from_gold = ["We agreed with Al Nakheel Company to deliver 240 units before the end of the month.",
"The deadline is 15 December, and Mazen is following up with the QA team."]
# ...and from the ASR transcript (the full pipeline).
from_asr = ["We agreed with Al Nakheel Company to deliver 214 units before the end of the month.",
"The deadline is 15 December, and Mazen is following up with the key team."]
chrf, bleu = CHRF(), BLEU()
for name, hyp in [("MT on human transcript", from_gold), ("ASR + MT", from_asr)]:
print(f"{name:24} chrF {chrf.corpus_score(hyp, [refs]).score:5.1f} BLEU {bleu.corpus_score(hyp, [refs]).score:5.1f}")
On these two toy sentences (SacreBLEU 2.6.0), it printed chrF 94.6 and BLEU 89.2 for the human-transcript path, and chrF 87.1 and BLEU 71.7 for the full pipeline. Two toy sentences prove nothing about a model. On your own clips, a large gap means you should improve recognition: better audio, a dialect test set as in Arabic dialect speech recognition, or another provider. A small gap with low scores overall means the translation step needs work: a better prompt, a glossary or a different model. To score the transcription step on its own, use word error rate.
Automatic scores rank systems; they don’t sign off on a translation. Have a bilingual reviewer read a sample, especially numbers, names and negations.
Which models should you use?
| Step | BroadNet model | Price | Notes |
|---|---|---|---|
| Transcribe | BroadNet Transcribe Arabic | $0.0042 a minute ($0.25 an hour) | Arabic only; on the $5 starting credit |
| Translate | Qwen3.8 27B | $0.175 in, $2.17 out per 1M tokens | Reasoning model; 262,144-token context; needs a top-up |
| Translate | Gemma 4 VL 26B | $0.10 in, $0.22 out per 1M tokens | On the starting credit; 32,768-token context, usually enough for a 10-minute part; check a sample in the token counter. Remove reasoning_effort, which BroadNet documents only for its reasoning models |
| Translate | DeepSeek V4.1 Flash | $0.175 in, $0.52 out per 1M tokens, or a flat session | Reasoning model; partner-hosted; needs a top-up or a plan |
Run the scoring script on the same clips with each translation model and pick on the scores and the reviewer’s notes, not on our table. Choosing an LLM for Arabic covers the wider trade-offs.
What does an hour of audio cost?
There are two parts:
- Transcription is per audio minute: $0.25 an hour on BroadNet Transcribe Arabic.
- Translation is per token:
prompt_tokens × input price + completion_tokens × output price, divided by 1,000,000. The prompt includes the system prompt, the glossary lines, the previous-part context and the transcript. The completion includes the English and, on reasoning models, the reasoning tokens.
We don’t publish a single per-hour translation figure, because it depends on how fast people speak, the dialect and how much the model reasons. Measure it: run one typical hour, add up usage.prompt_tokens and usage.completion_tokens from the responses, and put them into the LLM API cost calculator. Before you have audio, you can paste a sample transcript into the Arabic token counter; Arabic usually takes more tokens per word than English, as tokens per word in Arabic and English shows. The speech-to-text cost calculator prices the audio side.
For a large backlog, a flat DeepSeek V4.1 Flash session removes the token meter on the translation step: $1 an hour, $15 a week or $60 a month per session. One session runs one request at a time, so parallel workers need more sessions. Transcription is still billed per minute.
When is this pipeline the wrong choice?
- Live audio. Calls, live captions and voice agents need streaming results within seconds. A streaming speech-translation API, or a realtime endpoint, fits better than file uploads.
- Subtitles. BroadNet’s transcription response is text only, with no timestamps. Arabic subtitles from a text-only API shows how far chunk offsets get you; for word-level timing, use a provider that returns timestamps.
- Languages BroadNet doesn’t transcribe. The Arabic model handles Arabic. For other source languages, check the multilingual model’s 14-language list first.
- Legal or medical records. Use the pipeline for a draft and a human translator for the record.
Where BroadNet Inference fits
BroadRouter is BroadNet’s own site. BroadNet Inference offers both steps of this pipeline on one OpenAI-compatible key: Arabic transcription on /v1/audio/transcriptions and translation on /v1/chat/completions. It has no one-step speech-translation endpoint and no streaming transcription, so for live audio use another provider. Its privacy policy says inference content, including audio, transcripts and answers, is not retained; necessary account, billing and security metadata is retained. Start with the Arabic transcription page or the API reference, and test on your own recordings before you rely on the output.
