# Audio Transcription (Whisper): Speech to Text, SRT and VTT (`venture_ace/audio-transcription`) Actor

- **URL**: https://apify.com/venture_ace/audio-transcription.md
- **Developed by:** [Venture Ace](https://apify.com/venture_ace) (community)
- **Categories:** AI, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% 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

## Audio Transcription (Whisper)

Speech to text for audio and video files from direct URLs, using Whisper (faster-whisper, CTranslate2, MIT) on CPU.

- Input: `files` (direct file URLs), `model` (`base` default, `small`), `language` (`auto`), `outputFormats` (`segments`, `srt`, `vtt`; text is always returned), `maxAudioMinutes` (default 60, total per run).
- Output: one dataset row per file: `url, status (ok | failed | too_long), error, language, durationSec, text, segments, srt, vtt`.
- One bad file (dead link, not audio, page URL, too large) gives a `failed` row with the reason; the run continues with the next file.
- YouTube, TikTok, Instagram and other page URLs are refused. Localhost, private, link-local and CGNAT addresses are refused on every request and every redirect hop.
- No speaker diarization. Pricing: pay per usage of the platform (no actor fee yet); `small` costs about 2-3 times `base`.
- Speed: on the default 2 GB memory `base` runs at roughly 2x real time (one hour of audio takes about 30 minutes); `small` is 2-3 times slower. The run stops at the Actor timeout, so for `small` or long lists lower `maxAudioMinutes` or raise the timeout. A timeout or out-of-memory kill ends the run; only per-file problems are caught as `failed` rows.
- Accuracy depends on audio quality and language; `base` is weakest on non-English and noisy audio.
- Licences: Whisper code and weights MIT, faster-whisper MIT, CTranslate2 MIT; ffmpeg (Debian package, GPL build) is run as a separate program and not linked or redistributed.

Local test: `python -m unittest src/test_guard.py` from this folder.

# Actor input Schema

## `files` (type: `array`):

Direct links to audio or video files (mp3, wav, m4a, ogg, flac, mp4, webm and anything ffmpeg reads), one per line. Web-page links (YouTube, TikTok, Instagram and similar) are refused with a per-file error. Localhost and private addresses are refused. Max 500 MB per file.

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

base uses less compute and runs at roughly 2x real time on the default memory; small is more accurate and about 2-3 times slower (so costs more usage).

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

ISO code such as en, de, es, or auto to detect it from the audio.

## `outputFormats` (type: `array`):

Plain text is always returned. Add timed segments, SRT or VTT subtitles as needed.

## `maxAudioMinutes` (type: `integer`):

Safety cap on the total audio transcribed in this run. A file that would go past it is returned with status too_long and is not transcribed. At about 2x real time on the default memory, 60 minutes of audio takes about 30 minutes (small: longer); the run stops at the Actor timeout.

## Actor input object example

```json
{
  "files": [
    "https://upload.wikimedia.org/wikipedia/commons/9/9d/Eisenhower_-_Farewell_Address.ogg"
  ],
  "model": "base",
  "language": "auto",
  "outputFormats": [
    "segments"
  ],
  "maxAudioMinutes": 60
}
```

# Actor output Schema

## `transcripts` (type: `string`):

One row per file: status, language, duration, text, 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 = {
    "files": [
        "https://upload.wikimedia.org/wikipedia/commons/9/9d/Eisenhower_-_Farewell_Address.ogg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("venture_ace/audio-transcription").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 = { "files": ["https://upload.wikimedia.org/wikipedia/commons/9/9d/Eisenhower_-_Farewell_Address.ogg"] }

# Run the Actor and wait for it to finish
run = client.actor("venture_ace/audio-transcription").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 '{
  "files": [
    "https://upload.wikimedia.org/wikipedia/commons/9/9d/Eisenhower_-_Farewell_Address.ogg"
  ]
}' |
apify call venture_ace/audio-transcription --silent --output-dataset

```

## MCP server setup

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

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/fDIyJsLn9k2S6eZcN/builds/x5ColaDYf4AVsxUro/openapi.json
