BroadRouter

How to transcribe call center recordings: an Arabic-ready pipeline

By the BroadNet Inference team · 4 min read · Published

To transcribe call center recordings, split stereo files into agent and customer channels, cut each channel into speech turns, transcribe every turn with the right language code, then merge the turns by start time. Redact card numbers and phone numbers from the transcript before an LLM summarises the call. Mono recordings need a separate diarization step.

A support agent with a headset beside a screen showing a call transcript, with the text "Every call becomes insight."
Illustration of an app you could build; not a BroadNet product screenshot.

A call centre produces thousands of hours of audio a month, and almost none of it gets read. Transcripts make calls searchable. Summaries make them reviewable. This post builds the pipeline end to end, with an Arabic angle: dialects, mixed Arabic and English, and Eastern Arabic digits.

The steps:

  1. Inspect the recording: stereo or mono?
  2. Split stereo into agent and customer channels.
  3. Cut each channel into speech turns.
  4. Transcribe each turn with the right language.
  5. Merge turns into a dialogue by start time.
  6. Redact PII from the text.
  7. Summarise with an LLM into structured fields.

Step 1: is the recording stereo or mono?

ffprobe -v error -show_entries stream=channels,sample_rate,duration -of csv=p=0 call.wav
# 2,8000,412.6   -> stereo, 8 kHz telephone audio, 6.9 minutes

Many contact-centre recorders store the agent on one channel and the customer on the other. AssemblyAI’s contact-centre guide makes the same point: with separate channels, you get speaker separation without diarization. Check which side is which on a few calls; it is not always left for the agent.

Step 2: how do you split stereo channels with ffmpeg?

ffmpeg -i call.wav -af "pan=mono|c0=c0" -ar 16000 agent.wav
ffmpeg -i call.wav -af "pan=mono|c0=c1" -ar 16000 customer.wav

The pan filter keeps one channel, and -ar 16000 resamples to 16 kHz, the format BroadNet’s docs use for phone recordings.

Step 3: how do you cut each channel into speech turns?

This is a simple form of voice activity detection. Sending each full channel works, but you pay for every second of silence while the other party talks, which roughly doubles the bill on a stereo call. It also loses turn order. Cutting at silences fixes both:

import re, subprocess

def speech_turns(wav, noise="-35dB", min_silence=0.6):
    """Return (start, end) seconds of speech, using ffmpeg silencedetect."""
    log = subprocess.run(
        ["ffmpeg", "-i", wav, "-af", f"silencedetect=noise={noise}:d={min_silence}", "-f", "null", "-"],
        capture_output=True, text=True).stderr
    dur = float(subprocess.run(
        ["ffprobe", "-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", wav],
        capture_output=True, text=True).stdout)
    starts = [float(x) for x in re.findall(r"silence_start: ([\d.]+)", log)]
    ends = [float(x) for x in re.findall(r"silence_end: ([\d.]+)", log)]
    turns, cursor = [], 0.0
    for s, e in zip(starts, ends + [dur]):
        if s - cursor > 0.4:
            turns.append((cursor, s))
        cursor = e
    if dur - cursor > 0.4:
        turns.append((cursor, dur))
    return turns

Tune noise on your own recordings: noisy lines need a higher threshold such as -30dB.

Step 4: how do you transcribe each turn?

import os, tempfile
from openai import OpenAI

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

def transcribe_turns(wav, speaker, language="ar"):
    out = []
    for start, end in speech_turns(wav):
        with tempfile.NamedTemporaryFile(suffix=".wav") as seg:
            subprocess.run(["ffmpeg", "-y", "-loglevel", "error", "-i", wav,
                            "-ss", f"{start:.2f}", "-to", f"{end:.2f}", seg.name], check=True)
            with open(seg.name, "rb") as audio:
                text = client.audio.transcriptions.create(
                    model="broadnet/cohere-transcribe-arabic", file=audio, language=language).text
        out.append({"start": start, "speaker": speaker, "text": text.strip()})
    return out

Always send language. Without it, Arabic can come back in Latin letters. For English-language queues, use broadnet/cohere-transcribe with language="en". Keep a small worker pool: pay-as-you-go keys allow 4 requests at once and 30 a minute, and the errors and retries guide shows how to back off on 429.

Single files must stay under 25 MiB. A long monologue at 16 kHz mono WAV (about 32 KB a second) passes that at around 13 minutes; split it with -f segment -segment_time 600.

Step 5: how do you merge turns into a dialogue?

turns = transcribe_turns("agent.wav", "Agent") + transcribe_turns("customer.wav", "Customer")
dialogue = "\n".join(f'{t["speaker"]}: {t["text"]}' for t in sorted(turns, key=lambda t: t["start"]))

Overlapping speech shows up as two turns with close start times, which is what a human reviewer expects.

What about mono recordings?

Without channels you need speaker diarization: deciding who spoke when. Options:

Option How Trade-off
Open-source diarization Run pyannote.audio on your servers, then transcribe each speaker segment You host a model; audio stays with you
A provider with built-in diarization Several STT APIs return speaker labels; see the pricing comparison for add-on costs Another vendor in the data path
LLM role labelling Transcribe turns, then ask an LLM to label each turn Agent or Customer from context Cheap; wrong on short or ambiguous turns
Fix it at the source Switch the recorder to dual-channel Best long-term answer

BroadNet does not list diarization, so on mono audio pair it with one of the first three options.

Step 6: how do you redact PII, Arabic digits included?

Callers read card numbers, IBANs and phone numbers aloud. Transcripts may write them in Western digits (0-9) or Eastern Arabic digits (٠-٩). Normalise first, then redact:

EASTERN = str.maketrans("٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹", "01234567890123456789")

def redact(text):
    text = text.translate(EASTERN)
    text = re.sub(r"\b(?:\d[ -]?){13,19}\b", "[CARD]", text)
    text = re.sub(r"\b[A-Z]{2}\d{2}[A-Z0-9]{11,30}\b", "[IBAN]", text)
    text = re.sub(r"\+?\d[\d -]{7,}\d", "[PHONE]", text)
    return text

Numbers can also be spoken as words (“خمسة أربعة…”), which regex will miss. Sample transcripts by hand and add rules for what you find. The wider approach is in sending sensitive data to an LLM API.

Step 7: how do you summarise each call with an LLM?

import json
summary = client.chat.completions.create(
    model="broadnet/qwen3.8-27b",
    response_format={"type": "json_object"},
    messages=[
        {"role": "system", "content": "Summarise this call centre dialogue. Reply in English JSON with keys: "
                                      "reason, resolution, resolved (true/false), customer_sentiment, follow_up."},
        {"role": "user", "content": redact(dialogue)},
    ],
).choices[0].message.content
print(json.loads(summary))

Qwen3.8 27B supports structured output; always parse and validate the reply (how). BroadNet’s own test also found it understands Gulf and Egyptian dialects. Ask for English JSON if your dashboards are in English, even when the call is in Arabic.

Which quality checks come before the analytics?

Dashboards built on bad transcripts look just as confident as dashboards built on good ones. Add these checks to the pipeline:

  • Channel swap. If agent and customer labels are reversed on some recorder or queue, every “agent said” metric is wrong. Check the first turn: agents usually open with a greeting and a company name.
  • Empty or tiny transcripts. A turn that returns no text, or a call with under 20 words, usually means silence, hold music or a bad file. Flag it rather than summarising it.
  • Language mismatch. An English queue that suddenly produces Arabic text, or Arabic returned in Latin letters, points to a wrong language value.
  • Summary drift. Each week, have a supervisor compare 20 summaries with the full transcript. Track how often resolved is wrong.

Store the per-turn transcripts, not only the summary. When a summary is disputed, the turns are your evidence.

What does call transcription cost?

With turn cutting, billed audio is close to talk time. For 1,000 hours of Arabic speech:

Where BroadNet Inference fits

BroadNet covers steps 4 and 7 with one key and one base URL: Arabic and 13 other languages for transcription, and Arabic-tested chat models for the summary. Audio, transcripts and prompts are not retained (zero data retention), and BroadNet reports its Arabic model #2 of 37 (its September 2026 figure; the live board listed it #4 of 39 on 15 November 2026) on the Open Universal Arabic ASR Leaderboard.

It does not do diarization, real-time transcription or redaction for you; those stay in your pipeline. Before you commit, test your dialects using the method in Arabic dialect speech recognition.

Questions

How do I separate agent and customer in a call recording?

If the recording is stereo, the agent and customer are usually on different channels. Split them with ffmpeg and transcribe each channel on its own. If it is mono, you need speaker diarization.

Do I pay twice when I transcribe both stereo channels?

If you send each full channel, yes, because each channel is as long as the call. Cutting each channel into speech turns and sending only the turns brings the billed audio close to the actual talk time.

Can I transcribe Arabic calls with English words mixed in?

Yes, but test it. Gulf and Levantine agents often switch to English for product names and numbers. Check how those words come out on 20 real calls before you rely on keyword search or analytics.

Should I redact audio or text?

Redact the text transcript before it goes to an LLM, analytics or search. If you keep the audio, it still contains the spoken numbers, so restrict and expire the audio as well.

How long can each audio file be?

BroadNet accepts WAV or MP3 up to 26,214,400 bytes (25 MiB) per request. 16 kHz mono WAV is about 32 KB a second, so keep segments under about 13 minutes, or use MP3.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity