# Speaker Diarization & Transcription: Who Spoke When (`bossless/speaker-diarization`) Actor

Speaker diarization for any audio or video: who spoke when, as speaker turns and RTTM, plus a transcript with speaker labels and names, SRT/VTT subtitles and talk time per speaker. MP3, WAV, M4A or MP4 links, Google Drive or Dropbox. No API key. Pay per minute.

- **URL**: https://apify.com/bossless/speaker-diarization.md
- **Developed by:** [Alexander Daskalov](https://apify.com/bossless) (community)
- **Categories:** AI, Automation, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 audio minute processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

**Find out who spoke when in any audio or video file, and get a transcript with speaker names, subtitles and RTTM in one run.** Paste links to your files (MP3, WAV, M4A, MP4…, or Google Drive and Dropbox file links) and get, for every file:

- 🕒 **Who spoke when (speaker diarization)**: speaker turns with start and end times, plus the same turns in standard **RTTM** for diarization tools.
- 🗣️ **Transcript with speaker labels**: who said what and when, as JSON segments, readable text, **SRT** subtitles and **WebVTT** with `<v Name>` voice tags.
- 🏷️ **Names and roles**: speakers are named when the recording says who they are (or from your list of known names), with roles such as host, guest, interviewer, agent or customer.
- 📊 **Talk-time stats per speaker**, counted from the timestamps: talk seconds and share, turns, words per minute, questions asked, longest monologue, interruptions and long pauses.
- 🌍 **Most languages**: the transcript is written in the language spoken.

No API key, no account to connect, no setup. It works for podcasts, interviews, meetings, calls, lectures and videos.

### What can you do with it?

- **Podcast show notes:** see who said what, pull quotes per guest and give every guest their talk time.
- **Meeting minutes by person:** a transcript that says who raised each point, ready to summarise or search.
- **Interview research:** code qualitative interviews by speaker without listening to every recording twice.
- **Diarization models:** RTTM for training data, or as a baseline to compare against your own model with pyannote or dscore.
- **Subtitles with speaker names:** SRT and WebVTT voice tags for video players, editors and accessibility.
- **Talk-ratio analytics:** talk share, monologues and interruptions per speaker for calls, meetings and coaching.

### What files does it accept?

| Input | Example | Supported |
|---|---|---|
| Direct audio or video file link | `https://example.com/episodes/episode-42.mp3` | ✅ mp3, wav, m4a, aac, ogg, opus, webm, flac, mp4, mov… |
| Cloud storage or recording tool file URL | a public file URL from S3, another bucket or your recording tool | ✅ if it opens without logging in |
| Google Drive file | `https://drive.google.com/file/d/…/view` | ✅ shared as "Anyone with the link" |
| Dropbox file | `https://www.dropbox.com/scl/fi/…?dl=0` | ✅ |
| Folders, or pages that need a login | | ❌ share each file's own link |

Telephone-quality (8 kHz) audio works fine. Files up to 4 hours are supported. By default each file is capped at 120 minutes; raise **Max minutes per file** (up to 240) for longer files, or lower it to cap the cost of long ones.

### How much does it cost?

Pay per minute of audio. No monthly fee.

| Event | Price (FREE/BRONZE) | Lower on paid plans |
|---|---|---|
| Audio minute processed (turns, RTTM, transcript, SRT/VTT, stats) | **$0.009** / started minute | down to $0.008 |
| Actor start | $0.00005 / run | — |

A 60-minute podcast costs **$0.54**; a 10-minute interview costs **$0.09**. Minutes are counted per started minute processed. Nothing is charged for a file that fails.

**Cap your spend:** set a **maximum cost per run**. When the budget runs out, the file in progress is processed only up to what the budget covers and marked truncated.

**Free plan:** the AI runs on paid infrastructure, so free-plan runs include a 3-minute trial per run; upgrade to process full files.

### How to get speaker diarization (who spoke when)

1. Click **Try for free**. The example input processes a 1.7-minute sample podcast with three speakers (recorded with AI voices).
2. Paste your own links into **Audio or video links**, one per line.
3. Optional: set the **Number of speakers** if you know it, and add **Known speaker names** (for example the host and guests).
4. Run, then open the **Files**, **Speakers**, **Who spoke when** or **Transcripts** view, or download JSON, CSV or Excel.

#### Input example

```json
{
  "audioUrls": ["https://example.com/episodes/episode-42.mp3"],
  "expectedSpeakers": 3,
  "speakerNames": ["Emma", "Raj", "Lena"],
  "maxMinutesPerFile": 120
}
```

### Output

One record per file. Output from the example input (shortened):

```json
{
 "url": "https://api.apify.com/v2/key-value-stores/T5HtoeQYut1ufwkKC/records/sample-podcast.mp3",
 "source": "direct",
 "durationSeconds": 104.8,
 "processedSeconds": 104.8,
 "truncated": false,
 "language": "en-US",
 "speakerCount": 3,
 "speakers": [
  {"label": "S1", "name": "Emma", "role": "host", "displayName": "Emma", "talkSeconds": 41.0, "talkShare": 0.45, "turns": 6,
   "words": 120, "wordsPerMinute": 176, "questionsAsked": 4, "longestMonologueSeconds": 11.2},
  "…"
 ],
 "turns": [{"speaker": "S1", "start": 0.4, "end": 6.1}, "…"],
 "segments": [{"start": 0.4, "end": 6.1, "speaker": "S1", "text": "Welcome back to Build Notes…"}, "…"],
 "stats": {"talkSeconds": 90.1, "silenceSeconds": 0.0, "longPauses": 0, "interruptions": 0, "speakerChanges": 16, "speechShare": 0.86},
 "rttm": "SPEAKER sample-podcast-3f2a9c 1 0.400 5.700 <NA> <NA> S1 <NA> <NA>\n…",
 "srt": "1\n00:00:00,400 --> 00:00:06,100\nEmma: Welcome back…",
 "vtt": "WEBVTT\n\n00:00:00.400 --> 00:00:06.100\n<v Emma>Welcome back…",
 "text": "[00:00] Emma: Welcome back to Build Notes…",
 "processedAt": "2026-10-15T08:00:00+00:00"
}
```

Times (`start`, `end`) are seconds from the start of the file. A turn is one speaker's consecutive speech, merged across gaps of 1 second or less. Everything that must be exact (times, talk seconds, word and question counts, interruptions) is computed by code from the timestamps.

### Output formats

| Format | Field | Use it for |
|---|---|---|
| Speaker turns (JSON) | `turns` | who spoke when, in your own code |
| RTTM | `rttm` | diarization scoring and training tools (pyannote, dscore) |
| SRT | `srt` | subtitles with speaker names |
| WebVTT | `vtt` | web video subtitles with `<v Name>` voice tags |
| Plain text | `text` | reading, search and summaries |
| JSON segments | `segments` | transcript with times and speaker per segment |

### How accurate is it?

Measured on synthetic recordings with a known script (made with AI voices):

- **3-person podcast:** 17 of 17 speaker turns attributed correctly in each of 3 runs; median start-time error 0.1 seconds.
- **3-person support call at telephone quality (8 kHz):** 15 of 15 turns correct in each of 2 runs; median start-time error 0.14 to 0.2 seconds.
- **Best for 2–6 distinct voices.** On a 9-speaker court hearing where several similar voices take turns, voices were merged into fewer speakers. For panels and large meetings, treat speaker labels as approximate.
- **Overlapping speech:** each moment is given to one speaker.

### How fast is it?

Measured on Apify with the default 512 MB memory: a 2-minute file in about 10 seconds, and a 30-minute recording in about 3 minutes (191 seconds, of which 2 minutes is preparing the audio). More memory gives the run more CPU: with 2 GB the same 30-minute file took about 1 minute (63 seconds). Long files are processed in about 10-minute parts cut at pauses, and each part is told which speakers were already found, so a voice keeps its label for the whole file. Files in one run are processed one after another.

### Use it with AI agents (MCP)

```
https://mcp.apify.com?tools=bossless/speaker-diarization
```

Ask your assistant "who spoke when in this recording?", and it runs this actor and reads back the speaker turns and transcript.

### Use the API from code

```bash
curl -X POST "https://api.apify.com/v2/acts/bossless~speaker-diarization/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"audioUrls": ["https://example.com/episodes/episode-42.mp3"], "expectedSpeakers": 2}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("bossless/speaker-diarization").call(run_input={
    "audioUrls": ["https://example.com/episodes/episode-42.mp3"],
    "speakerNames": ["Emma", "Raj"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    for turn in item["turns"]:
        print(turn["speaker"], turn["start"], turn["end"])
    open("episode-42.rttm", "w").write(item["rttm"])
```

### FAQ

**Do I need an OpenAI, Deepgram, pyannote or other API key?** No. Everything is included in the price.

**Which languages work?** Most major languages. The transcript is written in the language spoken, and `language` tells you which one was detected.

**Can it identify speakers by name?** Yes, when the name is said in the recording ("I'm Emma, and today…") or given in **Known speaker names** and the recording makes clear who is speaking. Otherwise speakers are labelled S1, S2…, with a role when it's clear (host, guest, interviewer…).

**What about overlapping speech?** Each moment is given to one speaker, so when two people talk at once, the shorter interjection may be attributed to the main speaker. Interruptions are still counted in `stats`.

**What happens with a private or broken link?** It's skipped with a clear message and not charged.

**Is my data stored or used for training?** Files are downloaded only for the run and deleted when it ends. Results are saved in your own Apify dataset. The AI model runs on Google Cloud (Vertex AI). Google's terms say it won't use this data to train or fine-tune its models; it may cache requests for up to 24 hours and log them for abuse monitoring.

**How are minutes counted?** Per started minute of audio actually processed, so a 61-second file is 2 minutes.

**Is this an official product of any provider?** No. This is an independent tool and is not affiliated with or endorsed by any podcast, meeting, cloud storage or AI provider.

### Related tools

- [Call Recording Transcription & AI Call Analysis](https://apify.com/bossless/call-transcription-analyzer): speaker-labelled call transcripts with an AI summary, sentiment, action items and a QA scorecard.
- [Chinese Video Transcriber](https://apify.com/bossless/chinese-video-transcriber): Bilibili videos and any audio/video link to timestamped text, translation and SRT.

# Actor input Schema

## `audioUrls` (type: `array`):

Links to audio or video files: direct files (mp3, wav, m4a, aac, ogg, opus, webm, flac, mp4, mov...) from your website, cloud storage or recording tool, or Google Drive / Dropbox file links shared as 'Anyone with the link'. One file per line. Folders and pages that need a login don't work.

## `expectedSpeakers` (type: `integer`):

If you know how many people speak, say so: it makes speaker labels more reliable. 0 = detect automatically.

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

Up to 20 names of people who may speak, for example the host and guests of a podcast. A name is used only when the recording makes clear who is speaking; otherwise speakers stay S1, S2...

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

Longer files are processed up to this length and marked truncated. Caps the cost of an unexpectedly long file.

## Actor input object example

```json
{
  "audioUrls": [
    "https://api.apify.com/v2/key-value-stores/T5HtoeQYut1ufwkKC/records/sample-podcast.mp3"
  ],
  "expectedSpeakers": 0,
  "maxMinutesPerFile": 120
}
```

# Actor output Schema

## `results` (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 = {
    "audioUrls": [
        "https://api.apify.com/v2/key-value-stores/T5HtoeQYut1ufwkKC/records/sample-podcast.mp3"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bossless/speaker-diarization").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 = { "audioUrls": ["https://api.apify.com/v2/key-value-stores/T5HtoeQYut1ufwkKC/records/sample-podcast.mp3"] }

# Run the Actor and wait for it to finish
run = client.actor("bossless/speaker-diarization").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 '{
  "audioUrls": [
    "https://api.apify.com/v2/key-value-stores/T5HtoeQYut1ufwkKC/records/sample-podcast.mp3"
  ]
}' |
apify call bossless/speaker-diarization --silent --output-dataset

```

## MCP server setup

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

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/GPc3RtxtRDe7Fe2t7/builds/kEfWPuhUL4iNlupg1/openapi.json
