# Speaker Diarization & Transcription — Who Spoke When, SRT (`steadyscrape/speaker-diarization-transcriber`) Actor

Speaker diarization with transcription for any audio or video file link or podcast: who spoke when and who said what, speaker labels (Speaker 1, Speaker 2…) on every segment, talk time per speaker, SRT/VTT with speaker names. Whisper inside, 99 languages. Export to JSON, CSV or Excel, or via API.

- **URL**: https://apify.com/steadyscrape/speaker-diarization-transcriber.md
- **Developed by:** [Steady Scrape](https://apify.com/steadyscrape) (community)
- **Categories:** AI, Videos, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $25.00 / 1,000 audio minute with speakers, balanced qualities

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Speaker Diarization & Transcription — who spoke when, with SRT/VTT

**Speaker diarization** with transcription for any **audio or video file link** or **podcast feed**: the Actor finds
**who spoke when**, labels every sentence `Speaker 1`, `Speaker 2`…, and gives you the dialogue, each speaker's
**talk time and share**, their turns, and **SRT and WebVTT subtitles with the speaker's name** in every cue. 99
languages, detected automatically. Want only the timeline? The **speakers-only** mode skips the transcript and costs a
fraction.

**Everything runs inside the Actor.** Whisper transcribes, and an open speaker-diarization model (pyannote
segmentation + NVIDIA TitaNet voice embeddings, run through sherpa-onnx) tells the voices apart. There is no API key to
bring, no Hugging Face token to accept terms with, and no third-party service your audio is sent to.

**Pay per audio minute, only for files that gave a result.** A link that does not answer, a web page, a picture, a
file with no voice in it: each leaves one row that says what happened and **costs nothing**.

### What this speaker diarization Actor gives you

- **Who said what, sentence by sentence.** Whisper's segments often hold a question and its answer; the Actor splits
  them at the sentence and gives each sentence to the voice heard under it. On a NASA podcast it splits the host's
  "…to where you are today." from the guest's "It was a first visit…" inside one segment.
- **Speaker labels in the order people first speak**, or **your own names**: `speakerNames: ["Host", "Guest"]` turns
  Speaker 1 and Speaker 2 into Host and Guest everywhere — speakers, turns, dialogue and subtitles.
- **A known number of speakers, if you know it.** Leave `numberOfSpeakers` at 0 and the speakers are counted; give 2
  for an interview and the two most alike voices are merged, or a short voice is promoted, to give exactly two.
- **Clean speakers, not 30 fragments.** Voice models split one person into many small clusters (a laugh, a cough, a
  phone line). Short voices are folded into the speaker they sound like, or into the speaker talking around them; a
  voice that talks under 5 seconds, or under 2 % of the speech, is never a speaker on its own; music with no words
  (a jingle) is not a speaker.
- **Talk time per speaker**: seconds, share of the speech, number of turns, words, and when they first speak.
- **Subtitles that say who is talking**: SRT cues read `Speaker 1: Hello.` and WebVTT cues use the standard voice tag
  `<v Speaker 1>`, which players can style.
- **Podcast feeds, not just files.** Paste an RSS feed or an **Apple Podcasts show link** and the newest episodes are
  diarized, each row carrying the podcast, episode title, date, id and page.
- **Your spending limit is respected to the minute**: if it pays for 3 more minutes and the next file lasts 7, the first
  3 minutes are processed, the row says `truncated`, and the run stops.
- **Survives platform restarts**: files already delivered are not processed or charged twice.

### Use cases for speaker diarization

- **Interviews and podcasts**: a dialogue transcript ready for show notes, articles, quotes and search, with each
  guest's talk time.
- **Meetings and sales calls** recorded to a file: who said what, and who did most of the talking.
- **Subtitles with speaker names** for videos with several people: SRT/VTT straight into your editor or player.
- **Research and journalism**: turn-taking, interruptions and talk share across many recordings, as CSV or JSON.
- **AI pipelines**: feed an LLM or a RAG index a transcript that knows who is speaking. One JSON row per file.
- **Speakers-only diarization** before your own speech-to-text: the turns (`start`, `end`, `speaker`) are all you need.

### Input

| field | what it does |
|---|---|
| `mediaUrls` | Direct links to files: mp3, m4a, wav, flac, ogg, opus, aac, mp4, mov, webm, mkv… anything FFmpeg decodes. Up to 1,000 per run, 2 GB per file. Google Drive and Dropbox share links (shared with anyone with the link) are read as their file; a feed or an Apple Podcasts link given here is read as a podcast. |
| `podcastFeeds` | RSS/Atom feeds, or Apple Podcasts links: a show (`https://podcasts.apple.com/…/id123…`) is resolved to its public feed; an episode link (`…?i=1000…`) gives that episode. |
| `maxEpisodesPerFeed` | How many of the newest episodes of each feed (default 1, up to 500). |
| `mode` | `transcript` (default): speakers and what each one said. `speakers`: only who spoke when, no transcript. |
| `quality` | Transcript quality: `fast`, `balanced` (default) or `best`. See the table below. |
| `numberOfSpeakers` | 0 (default) counts them; 1–20 gives exactly that many. |
| `speakerNames` | Names for the speakers in the order they first speak (up to 60 characters each); the rest keep `Speaker N`. |
| `language` | `auto` (default) or a code: `en`, `es`, `de`, `fr`, `pt`, `it`, `nl`, `ja`, `zh`, `ar`, `hi`, `ru`… |
| `translateToEnglish` | The transcript comes out in English, in the same pass. Not with `best`. |
| `wordTimestamps` | Start, end and confidence of every word. |
| `includeSubtitles` | SRT and VTT with speaker names inside each row (default on). |
| `maxMinutesPerFile` | Read only the first minutes of each file; 0 = whole file. The form is prefilled with 2 so a first try costs 2 minutes. |

Calling it by API with another diarization Actor's field names works too: `startUrls`, `urls`, `audioUrls` and
`media_urls` are read like `mediaUrls`, and `numSpeakers`, `num_speakers` and `expectedSpeakers` like `numberOfSpeakers`.
A language may come in any case or with a region (`EN`, `en_US`, `pt-BR`), and an empty one means `auto`.

```json
{
    "mediaUrls": ["https://example.com/interview.mp3"],
    "numberOfSpeakers": 2,
    "speakerNames": ["Host", "Guest"],
    "quality": "balanced"
}
```

#### Speaker diarization quality, speed and price

Run memory buys speed: Apify gives one CPU core per 4 GB, and everything below is twice as fast at 8 GB, at the same
price per audio minute. Times are for 4 GB (the default) and are approximate: the Whisper part was measured on Apify,
the speaker part adds about 5 seconds per audio minute.

| mode / quality | model | a 60-minute recording takes | price per audio minute |
|---|---|---|---|
| `speakers` | speakers only | ~5 min | US$0.004 |
| `fast` | Whisper base + speakers | ~15 min | US$0.01 |
| `balanced` | Whisper small + speakers | ~35 min | US$0.025 |
| `best` | Whisper large-v3-turbo + speakers | ~65 min | US$0.045 |

`fast` is fine for clear speech in major languages, `balanced` is the sensible default, `best` is for accents, noise
and proper names. The speakers are found the same way in every quality. For long files raise the run's memory to 8 or
16 GB.

### Output

One row per file. This is the real row of the prefilled example (the first two minutes of an hour-long interview with
an interviewer and two scientists, CC BY 4.0, on Wikimedia Commons), shortened here:

```json
{
    "status": "ok",
    "reason": "only the first 120 s of 3722 s were read",
    "inputUrl": "https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg",
    "mediaUrl": "https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg",
    "episode": null,
    "contentType": "application/ogg",
    "fileSizeBytes": 55181110,
    "mode": "transcript",
    "quality": "balanced",
    "language": "en",
    "languageProbability": 0.6958,
    "translatedToEnglish": false,
    "durationSeconds": 3722.02,
    "processedSeconds": 120,
    "truncated": true,
    "billedMinutes": 2,
    "speakerCount": 3,
    "speakers": [
        { "speaker": "Speaker 1", "talkSeconds": 55.37, "talkShare": 0.539, "turnCount": 7, "wordCount": 146, "firstSpeaksAt": 0.1 },
        { "speaker": "Speaker 2", "talkSeconds": 38.04, "talkShare": 0.37, "turnCount": 10, "wordCount": 103, "firstSpeaksAt": 0.87 },
        { "speaker": "Speaker 3", "talkSeconds": 9.33, "talkShare": 0.091, "turnCount": 2, "wordCount": 21, "firstSpeaksAt": 29.83 }
    ],
    "text": "Speaker 1: Hi.\n\nSpeaker 2: Hello. How are you doing?\n\nSpeaker 1: Good, good.\n\n…",
    "wordCount": 270,
    "segments": [
        { "start": 0, "end": 0.44, "speaker": "Speaker 1", "text": "Hi.", "words": null },
        { "start": 0.84, "end": 1.16, "speaker": "Speaker 2", "text": "Hello.", "words": null },
        { "start": 3.16, "end": 4.02, "speaker": "Speaker 2", "text": "How are you doing?", "words": null }
    ],
    "turns": [
        { "start": 0.1, "end": 0.71, "speaker": "Speaker 1" },
        { "start": 0.87, "end": 1.45, "speaker": "Speaker 2" }
    ],
    "srt": "1\n00:00:00,000 --> 00:00:00,440\nSpeaker 1: Hi.\n\n2\n00:00:00,840 --> 00:00:01,160\nSpeaker 2: Hello.\n\n…",
    "vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:00.440\n<v Speaker 1>Hi.\n\n00:00:00.840 --> 00:00:01.160\n<v Speaker 2>Hello.\n\n…"
}
```

A podcast episode carries `episode`: `{ feedUrl, podcast, title, guid, publishedAt, pageUrl }`.

| field | meaning |
|---|---|
| `status` | `ok`, or why there is no result: `no_speech`, `unreachable`, `not_media`, `too_large`, `no_episodes`, `failed`, `invalid` (the input named nothing to process, or a setting rules every link out). Only `ok` is charged. |
| `reason` | In plain words: the HTTP status, what the link turned out to be, or how much of the file was read. |
| `speakers` | One entry per speaker: `talkSeconds`, `talkShare` of all speech, `turnCount`, `wordCount` (null in speakers-only mode), `firstSpeaksAt`. |
| `turns` | Who spoke when: `start`, `end` (seconds from the start of the file) and `speaker`. Pauses under half a second do not end a turn. |
| `text` | The dialogue: one paragraph per turn, opened by the speaker's label. |
| `segments` | `start`, `end`, `speaker`, `text`, and `words` when asked for. |
| `srt`, `vtt` | The subtitles with speaker names, ready to save as files. |
| `language`, `languageProbability` | What was spoken and how sure the engine is. |
| `durationSeconds`, `processedSeconds`, `truncated` | The file's length and how much of it was read. |
| `billedMinutes` | What this row cost, in audio minutes of its mode and quality. |
| `wordCount` | `null` for languages written without spaces (Chinese, Japanese, Thai), where a count would mislead. |

In speakers-only mode `text`, `segments`, `srt`, `vtt`, `language` and `quality` are null. The run's summary (files per
status, minutes billed) is in the key-value store as `SUMMARY`.

### Cost

| what | audio | price |
|---|---|---|
| The prefilled example, balanced | 2 min | US$0.05 |
| A 45-minute interview, balanced | 45 min | US$1.13 |
| The same, fast | 45 min | US$0.45 |
| The same, speakers only | 45 min | US$0.18 |

A file is billed by the started minute, at least one. There is no start fee and no per-file fee.

### Limits

- **Direct file links and feeds only.** A YouTube, TikTok or Instagram page is not a file; the Actor says so in a free
  row instead of trying to get around those sites.
- **Speakers are told apart by voice, not identified**: the Actor does not know who anyone is, only that two stretches
  sound like the same person. Names come from you.
- **Overlapping speech** goes to the voice heard most at that moment. Two people with very similar voices, or one
  person on two very different microphones, can be merged or split; `numberOfSpeakers` fixes the count when you know it.
- Voices that talk under 5 seconds in the whole file are folded into another speaker, unless `numberOfSpeakers` asks for them.
- Whisper can mishear names and rare words; `best` mishears fewer.
- 2 GB per file. Files are processed one after another: for many long files, run several runs side by side.
- Feeds that need a login or a private token in a header are not supported.

### Is speaker diarization legal?

The Actor downloads the files you point it at and nothing else. Process recordings you have the right to process:
your own, public-domain and openly licensed ones, or ones you have permission for. Voices and transcripts can be
personal data; telling speakers apart is not voice biometrics (no one is identified or matched against anyone), but the
GDPR and similar laws still apply to you as they would with any other tool.

Open models inside: Whisper (MIT, by OpenAI), pyannote segmentation 3.0 (MIT), NVIDIA NeMo TitaNet-S (NeMo's
Apache-2.0), sherpa-onnx (Apache-2.0). This Actor is not affiliated with OpenAI, pyannote or NVIDIA.

# Actor input Schema

## `mediaUrls` (type: `array`):

Direct links to files: interviews, podcasts, meetings, calls, webinars. mp3, m4a, wav, flac, ogg, opus, aac, mp4, mov, webm, mkv and anything else FFmpeg decodes. Google Drive and Dropbox share links (shared with anyone with the link) are read as their file, a podcast feed or an Apple Podcasts link as podcasts. A link that opens a web page (YouTube, a share page) is not a file and comes back as a free row that says so. startUrls, urls, audioUrls and media_urls sent by API are read the same way.

## `podcastFeeds` (type: `array`):

RSS or Atom feed links, or Apple Podcasts links: a show (https://podcasts.apple.com/…/id123456789) is resolved to its public feed and its newest episodes are processed; an episode link (…?i=1000…) gives that episode.

## `maxEpisodesPerFeed` (type: `integer`):

How many of the newest episodes of each feed to process.

## `mode` (type: `string`):

Transcript with speakers: who said what, every segment labelled Speaker 1, Speaker 2… Speakers only: who spoke when (turns and talk time per speaker), without a transcript, at a lower price.

## `quality` (type: `string`):

fast: Whisper base, fine for clear speech. balanced: Whisper small, good in most languages. best: Whisper large-v3-turbo, the most accurate, for accents, noise and proper names. Each is charged at its own price per audio minute. Not used in speakers-only mode.

## `numberOfSpeakers` (type: `integer`):

0 counts them. When you know it (an interview with 2 people, a panel of 4), give it: voices are merged or kept apart until there are exactly that many. numSpeakers and expectedSpeakers sent by API are read the same way.

## `speakerNames` (type: `array`):

Names in the order the speakers first speak ("Host", "Guest"…). They replace Speaker 1, Speaker 2… in the segments, the dialogue and the subtitles; speakers without a name keep their number.

## `language` (type: `string`):

"auto" detects it. Give a code (en, es, de, fr, pt, it, nl, ja, zh, ar, hi, ru… any of Whisper's 99) when you know it: it avoids a wrong guess on files that open with music or another language. Speaker detection works in any language.

## `translateToEnglish` (type: `boolean`):

Whisper writes the transcript in English instead of the spoken language, in the same pass. Not available with quality "best".

## `wordTimestamps` (type: `boolean`):

Start, end and confidence of every word, inside each segment.

## `includeSubtitles` (type: `boolean`):

Each row carries subtitles with the speaker in every cue ("Speaker 1: …" in SRT, a \<v Speaker 1> voice span in WebVTT), ready to save as .srt and .vtt.

## `maxMinutesPerFile` (type: `integer`):

Reads only the first minutes of each file; 0 reads the whole file. The example reads the first 2 minutes of an hour-long interview: set 0 for whole files.

## Actor input object example

```json
{
  "mediaUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg"
  ],
  "maxEpisodesPerFeed": 1,
  "mode": "transcript",
  "quality": "balanced",
  "numberOfSpeakers": 0,
  "language": "auto",
  "translateToEnglish": false,
  "wordTimestamps": false,
  "includeSubtitles": true,
  "maxMinutesPerFile": 2
}
```

# Actor output Schema

## `files` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mediaUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg"
    ],
    "maxMinutesPerFile": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyscrape/speaker-diarization-transcriber").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mediaUrls": ["https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg"],
    "maxMinutesPerFile": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("steadyscrape/speaker-diarization-transcriber").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mediaUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/f/f9/Harm_aversion_audio_interview_with_Christian_Keysers_and_Valeria_Gazolla.ogg"
  ],
  "maxMinutesPerFile": 2
}' |
apify call steadyscrape/speaker-diarization-transcriber --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadyscrape/speaker-diarization-transcriber"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FZoXP7fGMb0M5zV5f/builds/pm0YJT3ukjv8TUiQd/openapi.json
