# Speaker Diarization — who spoke when, with meeting notes (`amanatools/speaker-diarization`) Actor

Split any recording into speaker turns: transcript per speaker, talk-time stats, speaker-labelled SRT/VTT and ready-to-paste Markdown meeting notes. Whisper + voice clustering run inside the Actor — no API key. Failed or silent files are never billed.

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

## Pricing

Pay per event

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Speaker Diarization — who spoke when, with meeting notes

Send audio or video file URLs and get back the conversation **split by
speaker**: the transcript as speaker turns, per-speaker talk-time
statistics, speaker-labelled SRT/VTT subtitles, and **ready-to-paste
Markdown meeting notes**. Everything runs inside the Actor — Whisper for
the words, voice-embedding clustering for the speakers, all on CPU. No API
key, no external service, no per-provider markup.

> **Model note (Sep 2026):** the default model is now `tiny` (fastest, cheapest); choose `base` for accents, other languages or noisy audio. `small` was retired — a request for it runs `base`.

### What you get per file

- **`meeting_notes`** — Markdown you can paste straight into a doc: a
  participants table (talk time, share, turns, words) plus the turn-by-turn
  transcript with timestamps.
- **`turns`** — consecutive same-speaker speech grouped into turns:
  `{speaker, start, end, text}`.
- **`segments`** — fine-grained timestamped segments with speaker labels.
- **`speakers`** — per-speaker stats, ordered by talk time.
- **`srt` / `vtt`** — subtitles with `SPEAKER_N:` prefixes (VTT uses proper
  `<v SPEAKER_N>` voice tags, so capable players colour each speaker).
- **`text`**, detected `language`, `duration_seconds`, `billed_minutes`.

### Speakers

Leave **Number of speakers** at 0 and the Actor detects how many voices are
present (up to **Max speakers**). If you know the count — a 1-on-1
interview is 2, your weekly stand-up is 5 — set it explicitly: known counts
are always more accurate than detection.

Speakers are labelled `SPEAKER_1`, `SPEAKER_2`, … in order of first
appearance.

### Pricing — you only pay for delivered results

- **$0.005 per file** that delivers a speaker-labelled transcript, plus
- **$0.007 per started minute** of audio processed.

A file that fails to download, cannot be decoded, or contains no
recognizable speech is **never billed — not even the per-file fee**.
`max_minutes_per_file` is your hard cost ceiling per file:
max spend = $0.005 + $0.007 × that number.

### Sources and limits

- Direct media file URLs: mp3, m4a, aac, ogg, opus, wav, flac, mp4, webm, …
- Up to **25 URLs** per run, **250 MB** per file.
- Social-platform pages (YouTube, TikTok, …) are **not supported** — send
  direct media files you have the right to process.
- `tiny` and `base` models are baked into the image, so no run spends time
  downloading weights. (`small` was retired on 2026-09-04 — it ran 3× slower
  than `base` for a marginal gain; inputs that still say `small` run `base`.)
- Long recordings are processed up to `max_minutes_per_file` (default 30,
  max 480) and flagged `truncated`. If a run approaches its own timeout,
  the Actor delivers what it has — the partial transcript, or the
  speaker-labelled prefix if the clock runs out during diarization — and
  bills only the minutes actually delivered.

### Tips

- **Meetings & interviews:** keep VAD on, set `num_speakers` if you know it.
- **Raise the default run timeout** if you raise `max_minutes_per_file` far
  above the default — a 4-hour recording needs more than the default hour.
- Accuracy is best with one voice per channel-mixed recording of reasonable
  quality; heavily overlapping speech is attributed to the dominant voice.
- **Low-bandwidth phone recordings** (8 kHz call audio) of similar-sounding
  voices may be under-separated in auto-detect mode — voice embeddings lose
  most of their contrast there. Set `num_speakers` explicitly for call
  recordings; meeting/podcast-quality audio is unaffected.

# Actor input Schema

## `media_urls` (type: `array`):

Audio/video file URLs (mp3, m4a, wav, ogg, flac, mp4, webm, …). Up to 25 URLs per run. Note: social-platform pages (YouTube, TikTok, …) are not supported — send direct media files you have the right to process.

## `num_speakers` (type: `integer`):

How many people are in the recording, if you know. Leave at 0 to detect automatically.

## `max_speakers` (type: `integer`):

Upper bound for automatic speaker detection. Only used when 'Number of speakers' is 0.

## `model` (type: `string`):

Whisper model for the transcript. 'tiny' (default) is fastest and cheapest — good on clear speech; 'base' is more accurate for accents, other languages or noisy audio, about 2-3x slower (same price per minute, the run just takes longer).

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

ISO code like 'en', 'ar', 'es', 'ru' — or 'auto' to detect. Setting it explicitly is slightly faster and more reliable for short clips.

## `vad_filter` (type: `boolean`):

Voice-activity detection removes long silences before transcribing. Keep it on for meetings and interviews.

## `max_minutes_per_file` (type: `integer`):

Hard cap on processed audio per file — this is also your cost ceiling: max spend per file = $0.005 + $0.007 x this number. Longer recordings are processed up to the cap and flagged 'truncated'.

## `include_failed_files` (type: `boolean`):

When on, files that could not be downloaded or decoded appear in the dataset as error rows (never billed). Turn off to keep the dataset clean.

## Actor input object example

```json
{
  "media_urls": [
    "https://raw.githubusercontent.com/openai/whisper/main/tests/jfk.flac"
  ],
  "num_speakers": 0,
  "max_speakers": 8,
  "model": "tiny",
  "language": "auto",
  "vad_filter": true,
  "max_minutes_per_file": 30,
  "include_failed_files": true
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset: one item per file with speakers, turns, meeting notes, segments, srt and vtt.

# 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 = {
    "media_urls": [
        "https://raw.githubusercontent.com/openai/whisper/main/tests/jfk.flac"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("amanatools/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 = { "media_urls": ["https://raw.githubusercontent.com/openai/whisper/main/tests/jfk.flac"] }

# Run the Actor and wait for it to finish
run = client.actor("amanatools/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 '{
  "media_urls": [
    "https://raw.githubusercontent.com/openai/whisper/main/tests/jfk.flac"
  ]
}' |
apify call amanatools/speaker-diarization --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,amanatools/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/RQUeluK6kDTWu2uW8/builds/DgEfSvdQU74QAKZMd/openapi.json
