# Text To Speech (`vivid_astronaut/text-to-speech`) Actor

Convert text to natural speech using AI voices. Multiple voices and languages available. Generate audio files for podcasts, videos, accessibility, and voice assistants.

- **URL**: https://apify.com/vivid_astronaut/text-to-speech.md
- **Developed by:** [BRAINIALL Team](https://apify.com/vivid_astronaut) (community)
- **Categories:** AI, Developer tools
- **Stats:** 7 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$8.00 / 1,000 1,000 characters synthesizeds

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

## Multilingual Text to Speech (54 Voices) — by Brainiall

Convert text into **natural, high-fidelity human speech** across 54 realistic voices and multiple languages — optimized for podcasts, audiobooks, AI assistants, video voiceovers and localization pipelines.

Give it one or more text blocks and get back crisp audio files stored in the run Key-Value store, formatted in MP3, WAV or Opus, with public URLs pushed directly to your Apify dataset.

### What it does

- **Multilingual speech synthesis** — Generate natural-sounding speech across 54 distinct voices covering English, Spanish, Portuguese, French, German, Italian and more.
- **Multiple audio containers** — Choose between `mp3` (universal playback), `wav` (lossless quality for editing), or `opus` (ultra-compact storage/streaming).
- **Batch processing** — Pass a list of text paragraphs, chapters or script lines to process multiple audio tracks concurrently.
- **Key-Value audio storage** — Binary audio files are stored in your run's Key-Value store, returning lightweight HTTP URLs in the dataset output.
- **Custom speed & tone control** — Adjust speech velocity rate from `0.5x` (slow) to `2.0x` (fast).

Powered by the **Brainiall Text-to-Speech engine** ([api.brainiall.com](https://app.brainiall.com)) — high-performance speech synthesis engineered for enterprise applications.

### Who it's for

- **Content creators & Podcasters** — Automate voiceovers for YouTube shorts, podcasts, and social media posts.
- **E-learning & Publishers** — Convert articles, documentation, blog posts, and educational modules into engaging audiobooks.
- **AI Agent & App Developers** — Provide text-to-speech output for conversational AI agents, interactive voice response (IVR) systems, and accessibility tools.
- **Localization Teams** — Translate and synthesize audio in multiple global languages with matching voice accents.

### Input

```json
{
    "texts": [
        "Welcome to Brainiall Text to Speech service.",
        "Transform any written content into natural sounding voice audio across 54 realistic voices."
    ],
    "voice": "brainiall-en-us-1",
    "speed": 1.0,
    "lang": "en",
    "format": "mp3"
}
```

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| `texts` | Array | List of text strings to synthesize into speech audio files. | *Required* |
| `voice` | String | Voice ID identifier (e.g. `brainiall-en-us-1`, `brainiall-pt-br-1`). 54 voices available. | `brainiall-en-us-1` |
| `speed` | Number | Speech speed multiplier rate (`0.5` = slow, `1.0` = normal, `2.0` = fast). | `1.0` |
| `lang` | String | Language code (e.g. `en`, `pt`, `es`, `fr`, `de`). Auto-detected if omitted. | `en` |
| `format` | String | Output audio format: `"mp3"`, `"wav"`, or `"opus"`. | `"mp3"` |

### Output

One dataset item per input text block:

```json
{
    "index": 0,
    "text": "Welcome to Brainiall Text to Speech service.",
    "character_count": 44,
    "voice": "brainiall-en-us-1",
    "lang": "en",
    "speed": 1.0,
    "format": "mp3",
    "audio_key": "audio_1.mp3",
    "audio_url": "https://api.apify.com/v2/key-value-stores/xyz123/records/audio_1.mp3",
    "audio_size_bytes": 68420,
    "status": "success"
}
```

Export results as JSON, CSV, Excel, or download the raw audio files directly via the provided `audio_url` endpoints.

### Pricing

You pay **per synthesized character** (`character-synthesized` event). Failed requests or empty items are **never** charged. Costs scale transparently with the exact volume of text you convert.

### Tips

- For video editing software (Premiere, Final Cut, DaVinci), use `format: "wav"` for uncompressed audio quality.
- For web/mobile app playback or low-bandwidth storage, use `format: "mp3"` or `format: "opus"`.
- Split long books or scripts into paragraph-level array items (`texts`) to process sections concurrently and get faster overall completion times.

***

Built and maintained by [Brainiall](https://www.brainiall.com) — production AI APIs for speech, documents, vision and the web.

# Actor input Schema

## `texts` (type: `array`):

List of texts to convert into natural speech audio files. Each text item generates a dedicated audio file stored in the run key-value store.

## `voice` (type: `string`):

Voice identifier (e.g., brainiall-en-us-1, brainiall-pt-br-1, brainiall-es-es-1). Select from 54 high-quality multilingual voices.

## `speed` (type: `number`):

Playback speed multiplier (0.5x slow to 2.0x fast).

## `lang` (type: `string`):

Language code (e.g., 'en', 'pt', 'es', 'fr', 'de'). Optional, auto-detected if left empty.

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

Audio output container format: mp3, wav, or opus.

## Actor input object example

```json
{
  "texts": [
    "Welcome to Brainiall Text to Speech service.",
    "Convert any text into high-fidelity voice audio across 54 realistic voices."
  ],
  "voice": "brainiall-aria",
  "speed": 1,
  "lang": "en",
  "format": "mp3"
}
```

# 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 = {
    "texts": [
        "Welcome to Brainiall Text to Speech service.",
        "Convert any text into high-fidelity voice audio across 54 realistic voices."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vivid_astronaut/text-to-speech").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 = { "texts": [
        "Welcome to Brainiall Text to Speech service.",
        "Convert any text into high-fidelity voice audio across 54 realistic voices.",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("vivid_astronaut/text-to-speech").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 '{
  "texts": [
    "Welcome to Brainiall Text to Speech service.",
    "Convert any text into high-fidelity voice audio across 54 realistic voices."
  ]
}' |
apify call vivid_astronaut/text-to-speech --silent --output-dataset

```

## MCP server setup

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

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/N55Bn2FTT4XhnbUap/builds/Zj31wmYFb1YfNc5LQ/openapi.json
