# Fast Speech to Text: Parallel Whisper Transcription (`andrew_babo/fast-speech-to-text`) Actor

Transcribes one audio window per run so long videos can be split and transcribed in parallel. Whisper large-v3-turbo on CPU with word timestamps; supports Standby HTTP mode.

- **URL**: https://apify.com/andrew\_babo/fast-speech-to-text.md
- **Developed by:** [Andrew Babo](https://apify.com/andrew_babo) (community)
- **Stats:** 2,251 total users, 1,175 monthly users, 99.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Fast Speech to Text — Parallel Whisper Transcription for Long Audio & Video

Transcribe long media **fast** by splitting it into windows and running many
workers at once. Each run transcribes one window — or a whole list of windows
with the model kept warm — using faster-whisper (`large-v3-turbo`) on CPU with
word-level timestamps.

**Use it for:** hour-long podcasts, webinars, lecture archives, call recordings,
or any pipeline where waiting for a single sequential transcription is too slow.

- Word timestamps and confidence, 90+ languages
- One window per run, a batch of windows per warm worker, or a queue-driven worker pool
- Tail overlap with `_overlap` flags so merged shards de-duplicate cleanly
- Range-reads the source when the server supports it — no need to host the whole file per shard
- Optional Standby HTTP mode for low-latency requests

### Quick start — one window

```json
{
  "source": "https://example.com/audio16k.mp3",
  "start_sec": 0,
  "duration_sec": 240,
  "overlap_sec": 1.5,
  "language": "en",
  "preset": "fast",
  "model": "large-v3-turbo"
}
```

### Quick start — warm batch worker (recommended)

One run loads the model once and processes every window in the list:

```json
{
  "source": "https://example.com/audio16k.mp3",
  "mode": "batch",
  "windows": [
    { "job_id": "j1", "shard_index": 0, "source": "https://example.com/audio16k.mp3", "start_sec": 0,   "duration_sec": 240, "overlap_sec": 1.5 },
    { "job_id": "j1", "shard_index": 1, "source": "https://example.com/audio16k.mp3", "start_sec": 240, "duration_sec": 240, "overlap_sec": 1.5 }
  ]
}
```

Start N runs like this in parallel and a 60-minute file finishes in minutes.

### Input

| Field | Default | Notes |
| --- | --- | --- |
| `source` | — | **required.** `https://` URL or `kv:<storeId>/<key>` |
| `start_sec` | `0` | offset of this window on the original timeline |
| `duration_sec` | `240` | window length. 240–300 s is the measured sweet spot |
| `overlap_sec` | `1.5` | extra tail audio; those words are flagged `_overlap` |
| `language` | auto | ISO code (`en`, `vi`, …) |
| `preset` | `fast` | `fast` | `adaptive` | `balanced` | `accurate` |
| `model` | `large-v3-turbo` | also `distil-large-v3` (English only), `medium` |
| `vad_filter` | `false` | skip silence before decoding |
| `cpu_threads` | `4` | best value on a 16 GB run (≈4 vCPU) |
| `batch_size` | `8` | VAD chunks decoded in parallel; `0`/`1` = sequential |
| `allow_empty` | `true` | silent windows return 0 words instead of failing |
| `mode` | `""` | `""` one window, `batch` window list, `pool_worker` queue |
| `windows` | — | window list for `mode: "batch"` |
| `queue_id`, `dataset_id`, `worker_label` | — | `pool_worker` wiring |
| `idle_sec`, `max_life_sec`, `max_jobs` | `25`, `600`, `64` | worker leashes |

`distil-large-v3` is English-only and is automatically downgraded to
`large-v3-turbo` for non-English audio.

### Output

One dataset row per window:

```json
{
  "status": "success",
  "shard_index": 0,
  "start_sec": 0,
  "duration_sec": 240,
  "language": "en",
  "words": [
    { "text": "Hello", "startMs": 120, "endMs": 410, "confidence": 0.97 },
    { "text": "everyone", "startMs": 420, "endMs": 760, "confidence": 0.95, "_overlap": true }
  ],
  "segments": [{ "startMs": 120, "endMs": 4120, "text": "Hello everyone, welcome back" }],
  "meta": { "model": "large-v3-turbo", "rtf": 4.7, "decode_sec": 51.2 }
}
```

All timestamps are already offset back to the **original** timeline, so merging
shards is: concatenate, drop words flagged `_overlap` that duplicate the next
shard's first words, sort by `startMs`.

### Worker pool mode

For very large fan-outs, put the windows in an Apify request queue and start N
workers with `mode: "pool_worker"`. `fetch_next_request` is atomic, so two
workers never take the same window, and every worker pushes rows into one
shared dataset.

```json
{
  "source": "https://example.com/audio16k.mp3",
  "mode": "pool_worker",
  "queue_id": "<requestQueueId>",
  "dataset_id": "<datasetId>",
  "worker_label": "w1",
  "idle_sec": 25,
  "max_life_sec": 600,
  "max_jobs": 64
}
```

Queue mode requires the workers to run under the same account with full
permissions.

### Error handling

| `reason` | Meaning | What to do |
| --- | --- | --- |
| `BAD_INPUT` | missing `source`, invalid window | check the payload |
| `UPSTREAM_BLOCKED` | host refused the range request | host the audio yourself first |
| `TIMEOUT` | window too long for the run timeout | reduce `duration_sec` |
| `OOM_LIMIT` | not enough memory | run with 16 GB |
| `INTERNAL` | unexpected failure | retry that window only |

Retries are cheap: a failed window is one shard, not the whole file.

### Performance

16 GB run (≈4 vCPU), `large-v3-turbo`, `preset: fast`, `batch_size: 8`:

- real-time factor ≈ **4.7×** (a 240 s window decodes in ≈50 s)
- 60-minute file, 15 parallel workers → ≈3–5 minutes wall clock
- windows shorter than ~60 s waste fixed overhead; 240–300 s is optimal

### FAQ

**One window or batch mode?** Batch, whenever you have more than a couple of
windows — the model is loaded once instead of per run.

**How do I prepare the audio?** Extract a mono 16 kHz track once (see the
**Video & Audio Toolkit** actor, `op: "audio_full"`) and point every shard at
that one URL.

**Do I need a GPU?** No. CPU only.

**Can I get speaker labels?** Not here — pair the merged transcript with the
**Speaker Diarization** actor.

# Actor input Schema

## `source` (type: `string`):

https:// URL (public artifact URL from a previous run, or any reachable media) or kv:<storeId>/<key>. Range-queried when the server allows it.

## `start_sec` (type: `number`):

Offset of this shard on the original timeline.

## `duration_sec` (type: `number`):

Shard length before the tail overlap. 240-300s is the measured sweet spot for faster-whisper on CPU (RTF ~4.7x); short 15-45s shards waste fixed overhead.

## `overlap_sec` (type: `number`):

Extra audio past duration\_sec; words there are flagged \_overlap so the engine can dedupe.

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

ISO code (en, vi, ...). Omit for auto-detect.

## `preset` (type: `string`):

fast | adaptive | balanced | accurate

## `allow_empty` (type: `boolean`):

Silent windows return 0 words instead of failing.

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

Baked models. large-v3-turbo = multilingual default (Vietnamese OK). distil-large-v3 is ENGLISH-ONLY and is auto-downgraded to large-v3-turbo for non-English audio. medium = smaller/faster, lower accuracy.

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

Skip silence before decoding. Cuts compute on sparse audio but can clip word boundaries.

## `cpu_threads` (type: `integer`):

faster-whisper cpu\_threads. 4 measured best on a 16 GB Apify run (~4 vCPU).

## `batch_size` (type: `integer`):

BatchedInferencePipeline batch size: VAD chunks decoded in parallel so every cpu\_thread stays busy. 0/1 = sequential decode.

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

Empty = transcribe one window per run. 'batch' = one warm worker processes the list in 'windows' (recommended). 'pool\_worker' = pull windows from an Apify request queue (same account, full permissions required).

## `queue_id` (type: `string`):

Apify request queue holding the windows. fetch\_next\_request is atomic, so workers never take the same window twice.

## `dataset_id` (type: `string`):

Dataset every worker pushes its window rows into, so the engine reads one stream.

## `worker_label` (type: `string`):

Free-form label echoed back in each row for telemetry.

## `idle_sec` (type: `number`):

Exit after this many seconds with an empty queue. 2-120.

## `max_life_sec` (type: `number`):

Hard stop for one worker. 30-900.

## `max_jobs` (type: `integer`):

Hard stop after this many windows. 1-512.

## `windows` (type: `array`):

Pre-split window list for ONE warm worker: \[{job\_id,shard\_index,source,start\_sec,duration\_sec,overlap\_sec,preset,model,vad\_filter}]. The model is loaded once for the whole list.

## Actor input object example

```json
{
  "start_sec": 0,
  "duration_sec": 240,
  "overlap_sec": 1.5,
  "preset": "fast",
  "allow_empty": true,
  "model": "large-v3-turbo",
  "vad_filter": false,
  "cpu_threads": 4,
  "batch_size": 8,
  "mode": "",
  "idle_sec": 25,
  "max_life_sec": 600,
  "max_jobs": 64
}
```

# Actor output Schema

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

Dataset row: status, shard, meta {words, segments, word\_count}, timings, errors.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_babo/fast-speech-to-text").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("andrew_babo/fast-speech-to-text").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 '{}' |
apify call andrew_babo/fast-speech-to-text --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andrew_babo/fast-speech-to-text"
        }
    }
}
```

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/kW4vkYwCT6VylccZP/builds/gw8hVFi80ifnKdJZK/openapi.json
