# Audio Splitter & Compressor for Whisper and Speech-to-Text (`ataism/whisper-audio-splitter`) Actor

Split audio/video at pauses or compress under 25 MB for OpenAI Whisper, Groq & other STT APIs. Timestamps for stitching. ffmpeg, no AI key.

- **URL**: https://apify.com/ataism/whisper-audio-splitter.md
- **Developed by:** [Kaizoku Data](https://apify.com/ataism) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.

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

## Audio Splitter & Compressor for Whisper and Speech-to-Text

Make **your own** audio or video files ready for a speech-to-text API such as OpenAI Whisper / gpt-4o-transcribe, Groq, AssemblyAI or Deepgram. The Actor extracts the audio, **compresses it under an upload limit (OpenAI: 25 MB)** or **splits long recordings at pauses** into chunks, each with start and end times so you can stitch the transcripts back together.

**Price: $0.002 per minute of audio + $0.006 per 10 MB downloaded.** A 1-hour mp3 podcast costs about $0.16. Files that fail are not charged.

- **Split at pauses, not mid-word:** chunks under your size and length limits, with optional 0–5 s overlap and a manifest (`startSec`, `endSec`) for stitching.
- **Fit under the limit:** OpenAI 25 MB, Groq free tier 25 MB, Groq paid tier 100 MB, or a custom size.
- **Any format in, speech-ready out:** m4a, opus, webm, mp4, mov, wav and most other formats become mono 16 kHz mp3 (or m4a, ogg, flac, wav). Video and all metadata are removed.
- **Built for n8n, Make and Zapier** (n8n Cloud can't run ffmpeg) and for AI agents. It runs ffmpeg only: **no AI key, no transcription, no browser, no proxy.**
- **Quick start:** press *Start*. The prefilled input splits a 3.5-minute public-domain speech into 1-minute chunks: 4 mp3 files for about $0.014.

### Why

- OpenAI's transcription API rejects files over **25 MB**, so an hour-long recording or any video is too big.
- Phone and browser recordings (Android `.m4a`, WhatsApp `.opus`, browser `.webm`) are often rejected or mis-read.
- Splitting at a fixed length cuts words in half and ruins the transcript at every seam.

This Actor fixes all three in one step and hands back download links.

### What it does

| Operation | Result |
|---|---|
| **Split** (default) | Chunks no longer than **Max chunk length** (default 10 min) and no bigger than the **target size**, cut **in pauses**. The pause level adapts to each recording, so noisy audio still gets clean cuts. Optional overlap of 0 to 5 s. |
| **Fit** | One file compressed to fit the target size. The bitrate is lowered as needed, but not below what keeps speech clear (16 kbps for mp3 and m4a, 8 kbps for Opus). If it can't fit, the file is skipped (not charged) and you're told to use Split. |
| **Convert** | One file in the chosen format, with no size control. |

Every output is **mono, 16 kHz** by default (what speech models use) in **mp3** (accepted everywhere), m4a (AAC), ogg (Opus), flac or wav. Video, cover art, subtitles and **all metadata (tags, GPS, device names) are removed**.

**Targets:** OpenAI (25 MB), Groq free tier (25 MB), Groq paid tier (100 MB) or custom (1 to 150 MB). Files stay 3% below the limit.

### Input

| Field | What it does |
|---|---|
| **Audio or video file URLs** | Direct `http(s)` links, one per line: mp3, m4a, aac, wav, ogg, opus, webm, flac, mp4, mov, mkv, amr and most other formats ffmpeg reads. Default: a 3.5-minute public-domain speech, so the default run works. |
| **Uploaded files** | Upload from your computer (the field stores the file in a key-value store), or paste a key-value store record URL. |
| **What to do** | Split, Fit or Convert (see above). |
| **Target size limit** | OpenAI 25 MB, Groq 25 MB, Groq 100 MB or Custom. |
| **Max chunk length** | Split only. Default 10 minutes (some models also limit duration). |
| **Overlap** | Split only. 0 to 5 s repeated at the start of each later chunk. Overlap is not charged. |
| **Output format, bitrate, sample rate, mono** | Defaults: mp3, 48 kbps, 16000 Hz, mono. 48 kbps mono mp3 is about 21 MB per hour. |
| **Max input file size** | Default 500 MB, hard cap 2,000 MB. Also limited by the run's disk (2 × memory): the default 1 GB memory allows files up to about 1.2 GB. A file that would need more disk to process is skipped with a clear message, not charged. |
| **Max duration per file** | Default 240 min, hard cap 600 min. Longer files are skipped, not charged. |
| **Download timeout** | Per file, default 300 s. |

Example: split a list of meeting recordings for OpenAI, with 2 s overlap.

```json
{
  "audioUrls": ["https://files.example.com/meeting-2026-10-12.m4a", "https://files.example.com/interview.mp4"],
  "operation": "split",
  "target": "openai-25mb",
  "maxChunkMinutes": 10,
  "overlapSeconds": 2
}
```

Example: one WhatsApp voice note or phone recording, compressed into a single file under 25 MB for Groq's free tier.

```json
{
  "audioUrls": ["https://files.example.com/voice-note.opus"],
  "operation": "fit",
  "target": "groq-25mb"
}
```

Example: a long webinar video for Groq's paid tier (100 MB uploads), 30-minute chunks, smaller Opus files (check that your service accepts ogg first).

```json
{
  "audioUrls": ["https://files.example.com/webinar-recording.mp4"],
  "operation": "split",
  "target": "groq-100mb",
  "maxChunkMinutes": 30,
  "overlapSeconds": 3,
  "format": "ogg",
  "bitrateKbps": 32
}
```

### Output

One dataset row per output file. The audio files are in the run's key-value store, and `url` is a direct download link:

```json
{
  "inputIndex": 0,
  "sourceUrl": "https://files.example.com/meeting-2026-10-12.m4a",
  "fileName": "meeting-2026-10-12.m4a",
  "status": "ok",
  "operation": "split",
  "chunkIndex": 1,
  "chunkCount": 7,
  "startSec": 598.2,
  "endSec": 1196.84,
  "durationSec": 598.64,
  "overlapBeforeSec": 2,
  "cutAt": "silence",
  "url": "https://api.apify.com/v2/key-value-stores/<store>/records/0001-meeting-2026-10-12-002.mp3?signature=…",
  "key": "0001-meeting-2026-10-12-002.mp3",
  "sizeBytes": 3591840,
  "sha256": "…",
  "format": "mp3",
  "codec": "mp3",
  "bitrateKbps": 48,
  "sampleRate": 16000,
  "channels": 1,
  "sourceDurationSec": 3901.4,
  "sourceSizeBytes": 61234567,
  "sourceContainer": "mov,mp4,m4a,3gp,3g2,mj2",
  "sourceCodec": "aac",
  "sourceHadVideo": false,
  "warnings": [],
  "processedAt": "2026-10-19T09:00:00.000Z"
}
```

- `startSec` / `endSec` are positions in the **source**. Add `startSec` to the timestamps your speech-to-text service returns for a chunk to get times in the full recording. With overlap, drop the first `overlapBeforeSec` seconds of each later transcript.
- `cutAt` is `silence` (the cut is in a pause), `hard` (no pause near the limit, so the cut is at the limit and a few seconds of overlap helps) or `end`.
- A file that can't be processed gets one row with `status: "error"`, an `errorCode` and a `message`, and **is not charged**. Codes:
  - link and download: `invalid-url`, `blocked`, `platform`, `dns`, `network`, `http`, `redirects`, `timeout`, `too-large`, `not-media`, `disk`;
  - audio: `unreadable`, `no-audio`, `too-long`, `cannot-fit`, `too-many-chunks`, `chunk-too-large`, `output-too-large`, `ffmpeg`;
  - billing: `budget`.
- The `RUN_SUMMARY` record has counts, minutes and input charged, bytes downloaded and stored, and why the run stopped.

Links stay valid as long as the run's storage is kept (your account's data retention). Download the chunks or transcribe them before then.

### Use it via API, n8n or Make (full transcription flow)

The flow is always the same: **run this Actor → loop over the chunk rows → download each `url` → send it to your speech-to-text service → join the texts in `chunkIndex` order.** Get an Apify API token in Apify Console → *Settings* → *API & Integrations*, and keep it and your speech-to-text key in environment variables (`APIFY_TOKEN`, `OPENAI_API_KEY` or `GROQ_API_KEY` below).

**cURL** (step 1: run the Actor and get the chunk rows as JSON; this synchronous endpoint waits up to 5 minutes, which suits short files; for long recordings or many files use the clients below, which wait as long as the run takes):

```bash
curl -X POST "https://api.apify.com/v2/acts/ataism~whisper-audio-splitter/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"audioUrls": ["https://files.example.com/meeting.m4a"], "operation": "split", "target": "openai-25mb", "overlapSeconds": 2}'
```

Step 2, for each row with `"status": "ok"`: download `url` and transcribe it, for example with OpenAI (`whisper-1` or `gpt-4o-transcribe`) or Groq (`whisper-large-v3-turbo`; same request shape, at `https://api.groq.com/openai/v1/audio/transcriptions`):

```bash
curl -s -o chunk.mp3 "<url from the row>"
curl https://api.openai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F file=@chunk.mp3 -F model=whisper-1
```

**Python** (`pip install "apify-client>=3" openai`):

```python
import os, urllib.request
from apify_client import ApifyClient
from openai import OpenAI

apify = ApifyClient(os.environ["APIFY_TOKEN"])
run = apify.actor("ataism/whisper-audio-splitter").call(run_input={
    "audioUrls": ["https://files.example.com/meeting.m4a"],
    "operation": "split",
    "target": "openai-25mb",
    "overlapSeconds": 2,
})
chunks = [c for c in apify.dataset(run.default_dataset_id).iterate_items() if c["status"] == "ok"]
chunks.sort(key=lambda c: (c["inputIndex"], c["chunkIndex"]))

stt = OpenAI()  # OpenAI key from OPENAI_API_KEY. For Groq:
## stt = OpenAI(base_url="https://api.groq.com/openai/v1", api_key=os.environ["GROQ_API_KEY"])
texts = []
for c in chunks:
    audio = urllib.request.urlopen(c["url"]).read()
    result = stt.audio.transcriptions.create(model="whisper-1", file=(c["key"], audio))  # Groq: "whisper-large-v3-turbo"
    texts.append(result.text)
print("\n".join(texts))
```

(With apify-client versions before 3.0, `call()` returns a dict: use `run["defaultDatasetId"]`.)

**JavaScript** (`npm install apify-client`; Node 18+ for the built-in `fetch`):

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('ataism/whisper-audio-splitter').call({
    audioUrls: ['https://files.example.com/meeting.m4a'],
    operation: 'split',
    target: 'openai-25mb',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
const chunks = items.filter((c) => c.status === 'ok').sort((a, b) => a.chunkIndex - b.chunkIndex);

const texts = [];
for (const c of chunks) {
    const form = new FormData();
    form.append('file', await (await fetch(c.url)).blob(), c.key);
    form.append('model', 'whisper-1');
    const res = await fetch('https://api.openai.com/v1/audio/transcriptions', {
        method: 'POST',
        headers: { Authorization: `Bearer ${process.env.OPENAI_API_KEY}` },
        body: form,
    });
    texts.push((await res.json()).text);
}
console.log(texts.join('\n'));
```

**n8n** (n8n Cloud needs no ffmpeg):

1. Start with any trigger that gives you a direct file link (Webhook, Google Drive with a shared link, a form).
2. **Apify** node, operation **Run an Actor and get dataset**, Actor `ataism/whisper-audio-splitter`, input `{"audioUrls": ["{{ $json.fileUrl }}"], "operation": "split", "target": "openai-25mb"}`. It outputs one item per chunk, and the next nodes run once per item.
3. *Filter* on `status` = `ok`, then **HTTP Request** (GET `{{ $json.url }}`, response format *File*).
4. **OpenAI** node, *Audio* → *Transcribe a Recording* on that file; or for Groq an **HTTP Request** POST to `https://api.groq.com/openai/v1/audio/transcriptions` with *Form-Data*: `file` (the binary) and `model` = `whisper-large-v3-turbo`.
5. *Sort* by `chunkIndex`, then *Aggregate* the texts and join them. Add `startSec` to any timestamps your service returns.

**Make:**

1. **Apify** module **Run an Actor** with `ataism/whisper-audio-splitter` and your input, *Run synchronously* set to *Yes*.
2. **Apify** module **Get Dataset Items** with the run's default dataset ID: one bundle per chunk, so the next modules run once per chunk. Add a filter `status` = `ok`.
3. **HTTP** *Get a file* with the chunk's `url`.
4. Your transcription step: the OpenAI app's transcription action, or an HTTP request (multipart/form-data: `file` and `model`) to OpenAI's or Groq's `/audio/transcriptions` endpoint.
5. A **Text aggregator** joining the texts (sort by `chunkIndex` first). Zapier works the same way with the Apify app's run-Actor action and the Webhooks/OpenAI steps.

### Pricing

Pay per event, charged only for files that were processed and saved:

- **`audio-minute`: $0.002** per started minute of source audio (overlap is free);
- **`input-10mb`: $0.006** per started 10 MB downloaded;
- plus Apify's standard Actor-start event.

| Example | Cost |
|---|---|
| 1-minute voice note (1 MB) | $0.008 |
| 10-minute call (10 MB) | $0.026 |
| 1-hour podcast mp3 (58 MB) | $0.156 |
| 1-hour 720p video (700 MB) | $0.54 |
| 10 one-hour podcast mp3s (58 MB each) | $1.56 |

Failed downloads, non-media links, files that are too long or too big and files that can't fit are **not charged**. Set **Max total charge** in the run options to cap spending. The Actor checks the budget **before** working on each file, so it never charges part of a file. When the budget runs out, the rest of the list is skipped.

### Privacy

- Files are processed on the Actor's temporary disk and deleted as soon as each file is done. **The original file is never stored.** Only the outputs you asked for go into your run's key-value store.
- **No transcription, no analysis, no AI service.** The audio is not listened to, and nothing is sent anywhere except your own storage.
- All metadata is stripped from the outputs. Logs show only a URL's host and path (never its query string), the sizes and the status.
- Your dataset and key-value store belong to your Apify account and follow its retention settings. `sourceUrl` echoes what you supplied (including any signed query string).

### Safety and limits

- Only `http` and `https` links to **public** addresses are fetched. Private, loopback, link-local and internal addresses are blocked, including after redirects (at most 5, each re-checked) and at connection time.
- **Direct file links only.** Links to YouTube, TikTok, Instagram, Facebook, X, Vimeo, SoundCloud, Spotify, Twitch, Reddit, LinkedIn and Google services (including Google Drive) are refused: this Actor does not download from platforms. Upload the file instead.
- The first 4 KB of every download are checked; web pages and other non-media files are rejected at once.
- Limits: 1,000 files per run; input up to 2,000 MB and 600 min per file; at most 500 chunks per file; 150 MB per output file. Files are processed one at a time. Memory: default and minimum 1,024 MB. Give big files more memory, because disk is 2 × memory.
- Bad links cost download and run time even though they aren't charged. A run therefore stops after 50 failed files, after 20 minutes spent on failed files, or after 1,000 MB downloaded for them. A download that sends no data for 60 s is dropped.
- Billing uses the duration actually processed. If a file's header claims a shorter length than the audio really has, at most 10% + 5 s beyond the header is processed.
- If Apify restarts the run (for example, a server migration), it continues where it stopped. Files already finished are not processed or charged again.
- **You are responsible for having the right to process the files** you give this Actor (copyright, consent of the people recorded, data-protection law).
- Built with [FFmpeg](https://ffmpeg.org) (LGPL/GPL), run unmodified as a command-line tool.

### FAQ

**Does it transcribe?** No. It prepares the audio for the speech-to-text service you already use, with your own key and at its price (for example, Groq listed whisper-large-v3-turbo at about $0.04 per audio hour in October 2026).

**Why mp3 by default?** Every major speech-to-text API accepts it. Opus (ogg) is smaller for the same quality: check that your service accepts it before you switch.

**My file is a video.** That's fine: the audio track is extracted, and video is dropped.

**The cut fell in the middle of a word.** That happens only when there is no pause near the limit (`cutAt: "hard"`). Add 2 to 3 s of overlap, or raise the max chunk length.

# Actor input Schema

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

Direct http(s) links to audio or video files (mp3, m4a, wav, ogg, opus, webm, mp4, mov, flac and more), one per line. Private and local addresses are blocked. To use a file from your computer, upload it with the next field.

## `audioFiles` (type: `array`):

Upload files from your computer (the editor stores them in a key-value store), or paste key-value store record URLs.

## `operation` (type: `string`):

Split: chunks no longer than the max chunk length and no bigger than the target size, cut at pauses. Fit: one file compressed to fit the target size. Convert: one file in the chosen format, no size control.

## `target` (type: `string`):

The upload limit of your speech-to-text service. Files stay 3% below it.

## `customTargetMb` (type: `number`):

Only used when Target size limit is Custom. 1 to 150 MB.

## `maxChunkMinutes` (type: `number`):

Split only. Each chunk is at most this long (and always under the target size). Some models also limit duration, so 10 minutes is a safe default.

## `overlapSeconds` (type: `number`):

Split only. Each chunk after the first starts this many seconds before its cut, so no word is lost when a cut falls mid-word. 0 to 5. Overlap is not charged.

## `format` (type: `string`):

mp3 works everywhere. m4a and ogg (Opus) are smaller for the same quality, but check that your service accepts them. flac and wav are lossless and large (not available for Fit).

## `bitrateKbps` (type: `integer`):

For mp3, m4a and ogg. 48 kbps mono is clear for speech (about 21 MB per hour). Fit lowers it if needed to reach the target size.

## `sampleRate` (type: `integer`):

16000 Hz is what speech models use internally; higher rates only make files bigger.

## `mono` (type: `boolean`):

Mix down to one channel (recommended for speech). Turn off to keep the source's channels.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped, not charged. Hard cap 2000 MB; also limited by the run's disk (2x memory), so give big files more memory.

## `maxDurationMinutes` (type: `integer`):

Longer files are skipped, not charged. Hard cap 600 minutes.

## `downloadTimeoutSecs` (type: `integer`):

Per file, including redirects.

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

Internal: "selfTest" runs the maintainer health check and saves no items.

## Actor input object example

```json
{
  "audioUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/a/a5/Booker_T._Washington_reading_an_excerpt_from_his_1895_Atlanta_Compromise_speech.mp3"
  ],
  "operation": "split",
  "target": "openai-25mb",
  "customTargetMb": 25,
  "maxChunkMinutes": 1,
  "overlapSeconds": 0,
  "format": "mp3",
  "bitrateKbps": 48,
  "sampleRate": 16000,
  "mono": true,
  "maxFileSizeMb": 500,
  "maxDurationMinutes": 240,
  "downloadTimeoutSecs": 300,
  "mode": "run"
}
```

# Actor output Schema

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

One row per output file with its download link, start and end times and size, plus one row per skipped file.

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

The key-value store holding the audio files.

## `runSummary` (type: `string`):

Counts, minutes and input charged, bytes downloaded and stored, and why the run stopped.

# 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://upload.wikimedia.org/wikipedia/commons/a/a5/Booker_T._Washington_reading_an_excerpt_from_his_1895_Atlanta_Compromise_speech.mp3"
    ],
    "maxChunkMinutes": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("ataism/whisper-audio-splitter").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://upload.wikimedia.org/wikipedia/commons/a/a5/Booker_T._Washington_reading_an_excerpt_from_his_1895_Atlanta_Compromise_speech.mp3"],
    "maxChunkMinutes": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("ataism/whisper-audio-splitter").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://upload.wikimedia.org/wikipedia/commons/a/a5/Booker_T._Washington_reading_an_excerpt_from_his_1895_Atlanta_Compromise_speech.mp3"
  ],
  "maxChunkMinutes": 1
}' |
apify call ataism/whisper-audio-splitter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ataism/whisper-audio-splitter"
        }
    }
}
```

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/O8uMHjluT05CPMb5N/builds/UqXKukqDq7p9B8Kcv/openapi.json
