BroadRouter

Arabic subtitles (SRT) from a speech-to-text API: what you need

By the BroadNet Inference team · 7 min read · Published · Updated

An SRT file needs text plus a start and end time for every caption. APIs with word or segment timestamps, or direct SRT export, give the best timing. BroadNet Transcribe Arabic returns text only, so split audio at pauses, transcribe each chunk and time captions from the chunk offsets. Fine for talks and podcasts, not for frame-accurate film subtitles.

Subtitles are text with times attached. Most of the work in an Arabic subtitle pipeline is getting those times. Some speech-to-text APIs hand them to you as word timestamps or a finished SRT file. Others, including BroadNet Inference, return only the transcript text. This post explains what an SRT file needs, which providers document timestamps, and how to build usable Arabic subtitles from a text-only API, with the limits stated plainly.

BroadRouter is BroadNet’s own site. If you need frame-accurate timing, the honest answer below is a provider with word timestamps, not BroadNet.

What does an SRT file need?

An SRT (SubRip) file is plain text. Each caption has four parts: a number, a time line, one or two lines of text, and a blank line.

1
00:00:00,000 --> 00:00:02,800
مرحباً بكم في الحلقة الأولى

2
00:00:03,600 --> 00:00:07,600
اليوم نتحدث عن تحويل الكلام إلى نص وكيف
نصنع ملف ترجمة مصاحبة

The Library of Congress format description gives the time format as hours:minutes:seconds,milliseconds and the arrow as two hyphens and a right angle bracket. It also says SRT is “not well standardized” and that SRT files “do not have a character encoding standard”. For Arabic, write UTF-8 and test in your target player. WebVTT, its web successor, uses a full stop instead of the comma before milliseconds.

So the hard requirement is a start and end time for every caption. Text alone is not enough.

How long should an Arabic subtitle line be?

Use a published style guide rather than guessing. Netflix’s Arabic Timed Text Style Guide (change log dated 2025-12-19) sets:

Rule Netflix value
Characters per line 42
Lines per caption Two at most
Reading speed, adult programmes Up to 20 characters per second
Reading speed, children’s programmes Up to 17 characters per second
Line breaks Don’t split a verb from its subject, a preposition from its noun, or a number from what it counts

Netflix’s general requirements add a minimum of five-sixths of a second and a maximum of 7 seconds per caption. The Arabic guide also asks for Modern Standard Arabic in translated subtitles. That is a translation rule; a transcript of dialect speech stays in dialect.

Those numbers turn into code: wrap at 42 characters, two lines per caption, warn above 20 characters a second, and never hold a caption longer than 7 seconds.

Which speech-to-text APIs document timestamps or SRT?

We read each provider’s current docs on 15 November 2026. This lists what they document, not how accurate the timing is.

Provider What the docs offer Arabic
OpenAI response_format srt, vtt or verbose_json, and timestamp_granularities[] word or segment, on whisper-1 only. gpt-4o-transcribe and gpt-4o-mini-transcribe return json only Not checked. OpenAI’s deprecations page lists whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe and gpt-4o-transcribe-diarize as deprecated, all shutting down on February 26, 2027, and recommends gpt-transcribe or gpt-live-transcribe instead
AssemblyAI GET /v2/transcript/{transcript_id}/srt or /vtt, with chars_per_caption Arabic listed on Universal-2, in its 10 to 25% WER band
Speechmatics format=srt on the transcript endpoint; srt_overrides with max_line_length and max_lines; word items carry start_time and end_time Arabic, plus an ar_en Arabic-English pack
Deepgram Word and utterance timestamps; official Python and JavaScript caption libraries that write SRT and WebVTT Arabic and regional codes on Nova-3
ElevenLabs timestamps_granularity word or character; each word has start and end in seconds Arabic listed, in its 10 to 20% WER band
BroadNet Inference {"text": ...} only Arabic-specific model and a 14-language model

If you can run models yourself, FFmpeg’s whisper filter, built against whisper.cpp, can write srt directly and has a max_len option for shorter lines.

For a first comparison of Arabic accuracy and price, see the Arabic speech-to-text API buyer’s guide and speech-to-text pricing compared. Timestamps are one row in that decision, not the only one.

How do you make subtitles from a text-only API?

You make your own timestamps from where you cut the audio. The steps:

  1. Find the pauses. FFmpeg’s silencedetect logs silence_start and silence_end in seconds wherever the level stays below a threshold for a minimum time.
  2. Turn pauses into speech spans. Everything between two silences is one span. Cap spans at about 12 seconds, so a speaker who never pauses still produces short captions.
  3. Transcribe each span. Cut it to 16 kHz mono WAV and send it with language=ar.
  4. Time the captions. The span’s start and end are your anchor times. If its text needs several lines, share the span’s time between them in proportion to their length.
  5. Write SRT and check line length, reading speed and duration against the style rules.

This is the same splitting as in transcribing long audio files, with a different goal. There, chunks are about 10 minutes and you only care about the joined text. Here, chunks are seconds long because each one becomes caption times. The audio splitter tool builds the FFmpeg commands if you prefer to split by hand.

The pipeline in Python

This script uses the OpenAI Python SDK and FFmpeg. We ran it on 15 November 2026 against a local mock server that answers like BroadNet’s documented endpoint ({"text": ...}), with a generated test file of tones and gaps. The SRT above is its output. No BroadNet key was used, so the Arabic text came from the mock, not from the model.

import os, re, subprocess, sys
from openai import OpenAI

FFMPEG = os.environ.get("FFMPEG", "ffmpeg")
client = OpenAI(base_url=os.environ.get("BASE_URL", "https://inference.broadnet.ai/v1"),
                api_key=os.environ["BROADNET_API_KEY"])
MODEL = "broadnet/cohere-transcribe-arabic"
MAX_CHARS, MAX_LINES, MAX_CUE, MAX_CPS = 42, 2, 7.0, 20   # Netflix Arabic / general guide values

def find_speech(path, noise="-35dB", min_silence=0.4, max_span=12.0):
    """Return [(start, end)] seconds of speech between silences, each at most max_span long."""
    log = subprocess.run([FFMPEG, "-hide_banner", "-nostats", "-i", path,
                          "-af", f"silencedetect=n={noise}:d={min_silence}", "-f", "null", "-"],
                         capture_output=True, text=True).stderr
    h, m, s = re.search(r"Duration: (\d+):(\d+):([\d.]+)", log).groups()
    total = int(h) * 3600 + int(m) * 60 + float(s)
    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)]
    spans, t = [], 0.0
    for i, s0 in enumerate(starts):
        if s0 - t > 0.2:
            spans.append((t, s0))
        t = ends[i] if i < len(ends) else total
    if total - t > 0.2:
        spans.append((t, total))
    out = []
    for a, b in spans:                       # no pause found: cut at a fixed length
        while b - a > max_span:
            out.append((a, a + max_span)); a += max_span
        out.append((a, b))
    return out

def transcribe_span(path, a, b, name):
    subprocess.run([FFMPEG, "-hide_banner", "-loglevel", "error", "-y", "-ss", f"{a:.3f}",
                    "-to", f"{b:.3f}", "-i", path, "-ar", "16000", "-ac", "1", name], check=True)
    with open(name, "rb") as f:
        return client.audio.transcriptions.create(model=MODEL, file=f, language="ar").text.strip()

def to_cues(text, a, b):
    """Wrap text into lines of <= MAX_CHARS, give each line a share of the span's time
    in proportion to its length, then pack lines into cues of <= MAX_LINES and <= MAX_CUE s."""
    lines, cur = [], ""
    for w in text.split():
        if cur and len(cur) + 1 + len(w) > MAX_CHARS:
            lines.append(cur); cur = w
        else:
            cur = f"{cur} {w}".strip()
    if cur:
        lines.append(cur)
    chars = sum(len(l) for l in lines) or 1
    cues, t = [], a
    for line in lines:
        d = (b - a) * len(line) / chars
        last = cues[-1] if cues else None
        if last and len(last[2]) < MAX_LINES and t + d - last[0] <= MAX_CUE:
            last[1] = t + d; last[2].append(line)
        else:
            cues.append([t, t + d, [line]])
        t += d
    for c in cues:                           # a long pause inside a span: don't hold text on screen
        c[1] = min(c[1], c[0] + MAX_CUE)
    return cues

def ts(x):
    ms = round(x * 1000)
    return f"{ms // 3600000:02}:{ms // 60000 % 60:02}:{ms // 1000 % 60:02},{ms % 1000:03}"

def make_srt(path, out="out.srt"):
    cues = []
    for i, (a, b) in enumerate(find_speech(path)):
        text = transcribe_span(path, a, b, f"chunk-{i:04}.wav")
        if text:
            cues += to_cues(text, a, b)
    with open(out, "w", encoding="utf-8") as f:
        for n, (a, b, g) in enumerate(cues, 1):
            cps = len(" ".join(g)) / (b - a)
            if b - a > MAX_CUE or cps > MAX_CPS:
                print(f"check cue {n}: {b - a:.1f} s, {cps:.0f} chars/s", file=sys.stderr)
            f.write(f"{n}\n{ts(a)} --> {ts(b)}\n" + "\n".join(g) + "\n\n")
    return len(cues)

if __name__ == "__main__":
    print(make_srt(sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else "out.srt"), "cues written")

Run it with BROADNET_API_KEY set: python make_srt.py episode.wav episode.srt. On the test file, the pause detection found spans at 0 to 2.8 s, 3.6 to 7.6 s, 8.8 to 28.8 s (cut at 12 s because it had no pause) and 29.4 to 30.9 s, which matched how the file was built. The output parsed cleanly with the Python srt package and converted to WebVTT with FFmpeg.

Tune two values to your audio. noise is the level that counts as silence: try -30 to -40 dB for clean speech and higher for noisy rooms. min_silence is how long a gap must last: 0.3 to 0.5 seconds catches pauses between sentences without splitting every breath.

How accurate is chunk-level timing?

Be clear about what this method can and can’t do.

  • Span edges are the best part. Caption starts and ends that fall on a real pause are as accurate as the silence detection. On our synthetic test file they matched exactly; real recordings with breaths and room noise are messier.
  • Times inside a span are estimates. When a span holds two or three captions, the script shares its time by character count. Speakers don’t talk at a constant rate, so those inner boundaries can be off by a second or more.
  • Fixed cuts can split words. When a span runs past the 12-second cap without a pause, the cut lands wherever it lands. A word at the cut may be lost or garbled. Raise noise or lower min_silence first, so fewer spans need a fixed cut.
  • Short chunks give the model less context. A 3-second clip has fewer words around each word than a 10-minute file. We have not measured how much this changes Arabic accuracy; test it on your own audio with WER.
  • No speaker labels. BroadNet returns no diarization, so captions don’t say who is speaking.
  • Music and noise. Background music can hide pauses entirely. Then most spans are fixed cuts, and timing gets worse.

For lectures, podcasts, webinars and training videos, captions within a second of the speech are usually readable. For drama, music videos or anything lip-synced, use a provider with word timestamps or have a subtitler adjust the file.

What does it cost, and how fast is it?

Price follows audio length. One hour of Arabic on BroadNet Transcribe Arabic costs $0.25, whether you send it as one file or 720 five-second ones. BroadNet’s pricing page lists a price per audio minute and no per-file minimum; check the usage page after your first episode to confirm.

Speed follows request count. A pay-as-you-go key allows 30 requests a minute and 4 in flight. An hour of speech split into 5-second spans is about 720 requests, which takes at least 720 ÷ 30 minutes. Longer spans mean fewer requests. If you hit 429, back off as in the errors and retries guide, and don’t spread one job across keys to get around the published limits.

Where BroadNet Inference fits

BroadNet Transcribe Arabic suits the text half of a subtitle job: Arabic speech to Arabic text at $0.0042 a minute, with audio and transcripts not retained after the request. The $5 starting credit covers transcription, so you can test the pipeline on real episodes before you top up. It does not return timestamps, segments, speaker labels or SRT. If your subtitles need word-level timing, use a provider that documents it, or align BroadNet’s text to the audio with a forced-alignment tool. Request shapes and limits are in the BroadNet API reference, and setup is in the Arabic speech-to-text guide.

Questions

Can I get an SRT file directly from BroadNet's transcription API?

No. BroadNet's docs show a JSON response with one text field, and no SRT, VTT or timestamp option. Its /v1/models metadata (checked 2026-11-15) lists json, text and verbose_json response formats, but no source says verbose_json carries timestamps. Build the timing yourself from chunk offsets, as in this post, or use a provider that documents timestamps.

Which speech-to-text APIs export SRT for Arabic?

Among those we checked on 15 November 2026, AssemblyAI (a subtitles endpoint, Arabic on Universal-2) and Speechmatics (format=srt, Arabic and an Arabic-English pack) document SRT export. OpenAI documents SRT on whisper-1, which is deprecated. Deepgram documents caption libraries built on its timestamps.

How many characters per line should Arabic subtitles have?

Netflix's Arabic Timed Text Style Guide sets 42 characters per line and a maximum of two lines. Its reading-speed limit for adult programmes is up to 20 characters per second, and 17 for children's programmes.

How accurate are subtitles timed from audio chunks?

Each chunk's start and end are as accurate as the pause detection, so tune it on your audio. Captions inside a chunk get times estimated from text length, so they can drift by a second or more. That suits talks and podcasts, not lip-synced drama.

Why does my Arabic SRT show punctuation on the wrong side?

SRT has no direction markup, so the player decides how to lay out right-to-left text. Test the file in the players your audience uses. If punctuation moves, try a format with richer styling or a player setting for RTL text.

Does splitting audio into short chunks cost more?

BroadNet prices transcription per audio minute, so the total audio is the same. It does mean more requests: short chunks hit the pay-as-you-go limit of 30 requests a minute sooner. Check your usage page after a first run to confirm billing.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity

Sources