# AI Voice Cloning Text to Speech - English (`andrew_babo/chatterbox-tts`) Actor

Clone a voice from one short English recording and make it read any script with natural expression, including laughs and sighs. Built-in default voice, long text support, MP3/WAV/Opus output. No rental fee - you pay Apify compute only.

- **URL**: https://apify.com/andrew\_babo/chatterbox-tts.md
- **Developed by:** [Andrew Babo](https://apify.com/andrew_babo) (community)
- **Categories:**
- **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?

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

## AI Voice Cloning Text to Speech — Expressive English Voices

Clone a voice from one short recording and make it read any English script — with natural expression, including laughs and sighs. This is the quality-first option when the voice has to sound convincingly human.

**Good for:** branded narration in your own voice, character voices for stories and games, podcast and YouTube voiceovers, ads, audiobook samples, dubbing tests.

### Quick start

```json
{
  "text": "Oh, that is hilarious! [laugh] Anyway, how are you today?",
  "ref_audio_url": "https://example.com/my-voice.wav",
  "format": "mp3"
}
```

No reference clip? Leave `ref_audio_url` empty and a built-in voice is used.

### What you get

- **Voice cloning** from a clean 5–15 second English recording
- **Expressive delivery** with inline cues such as `[laugh]`, `[chuckle]`, `[cough]`
- **Built-in default voice** when you don't supply a reference
- **Long text supported** — split and joined with smooth transitions
- **Speed control**, silence trimming, MP3 / WAV / Opus output
- One dataset row per run with the audio URL and timings

### Input

| Field | Default | What it does |
|---|---|---|
| `text` | required | The script to read |
| `ref_audio_url` | — | Link to the voice you want to clone |
| `speed` | `1.0` | Playback speed |
| `dtype` | `fp32` | Use a quantized option to trade a little quality for speed |
| `format` | `wav` | `wav`, `mp3` or `opus` |

### Pricing

No rental fee — you only pay Apify compute. This Actor prioritises quality, so a long script takes longer than the fast voice Actors; for bulk jobs use the Fast Text to Speech Actor instead.

### Notes

- **English only.** For Vietnamese use the Vietnamese Text to Speech Actor.
- Only clone voices you own or have permission to use.

# Actor input Schema

## `text` (type: `string`):

Required English text to synthesize. Chatterbox automatically splits long text. Paralinguistic tags such as \[laugh], \[cough], and \[chuckle] are experimental. Maximum 20,000 characters.

## `ref_audio_url` (type: `string`):

Public URL to 5-15 seconds of clean speech to clone. Leave empty to use the bundled default voice.

## `dtype` (type: `string`):

ONNX graph precision. fp32 is the tested default for Apify CPU.

## `repetition_penalty` (type: `string`):

Higher values reduce looping and stuttering artifacts in long passages.

## `max_new_tokens` (type: `integer`):

Optional safety cap. Leave empty to estimate a safe budget from chunk length.

## `speed` (type: `string`):

Playback rate multiplier applied after synthesis. 1.0 is natural.

## `crossfade_ms` (type: `integer`):

Short fade at sentence boundaries to avoid clicks without removing the natural pause.

## `trim_silence` (type: `boolean`):

Keep sentence pauses natural while removing excessive dead air at chunk edges.

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

Container/codec of the returned audio file.

## `stream` (type: `boolean`):

Reserved for a future streaming endpoint; keep false for the current stable audio response.

## `chunk_chars` (type: `integer`):

Short chunks reduce decoder drift and allow earlier streaming.

## `chunk_parallel` (type: `integer`):

0 uses the tuned default of 2 concurrent chunks; use 1 for lowest RAM.

## Actor input object example

```json
{
  "text": "Oh, that's hilarious! [chuckle] Anyway, how are you doing today?",
  "dtype": "fp32",
  "repetition_penalty": "1.2",
  "speed": "1.0",
  "crossfade_ms": 15,
  "trim_silence": true,
  "format": "wav",
  "stream": false,
  "chunk_chars": 150,
  "chunk_parallel": 0
}
```

# Actor output Schema

## `audio` (type: `string`):

Generated audio record stored in the run's key-value store (audio.wav / audio.mp3 / audio.ogg).

## `metrics` (type: `string`):

Dataset rows with engine, duration, synthesis time, RTF, peak RAM and the audio URL.

# 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 = {
    "text": "Oh, that's hilarious! [chuckle] Anyway, how are you doing today?"
};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_babo/chatterbox-tts").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 = { "text": "Oh, that's hilarious! [chuckle] Anyway, how are you doing today?" }

# Run the Actor and wait for it to finish
run = client.actor("andrew_babo/chatterbox-tts").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 '{
  "text": "Oh, that'\''s hilarious! [chuckle] Anyway, how are you doing today?"
}' |
apify call andrew_babo/chatterbox-tts --silent --output-dataset

```

## MCP server setup

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

```

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/7Iw26RFNpiHXbSKFD/builds/r2kXaJxVlDkXbWLPF/openapi.json
