# Multilingual Text to Speech & Voice Cloning (`andrew_babo/qwen3-tts`) Actor

Turn text into natural speech in 10 languages, steer delivery with a plain-language style note, or clone a voice from a short clip. Preset speakers, speed control, MP3/WAV/Opus output. No rental fee - you pay Apify compute only.

- **URL**: https://apify.com/andrew\_babo/qwen3-tts.md
- **Developed by:** [Andrew Babo](https://apify.com/andrew_babo) (community)
- **Categories:**
- **Stats:** 7 total users, 6 monthly users, 25.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

## Multilingual Text to Speech & Voice Cloning — 10 Languages

Turn text into natural speech in 10 languages, steer the delivery with a plain-English style note ("speak warmly and slowly"), or clone a voice from a short recording.

**Good for:** multilingual voiceovers, e-learning and course narration, ads and product videos, character voices, localisation of existing scripts.

### Quick start

```json
{
  "text": "Hello, welcome to the demo.",
  "language": "English",
  "voice": "Vivian",
  "instruct": "Speak warmly and clearly.",
  "format": "mp3"
}
```

Clone a voice instead:

```json
{
  "text": "Now I read in the cloned voice.",
  "ref_audio_url": "https://example.com/my-voice.wav",
  "format": "mp3"
}
```

### What you get

- **10 languages**: English, Chinese, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian
- **Preset speakers** — male and female, several styles
- **Style control** — describe the mood and pacing in your own words
- **Voice cloning** from a short reference clip
- **Speed control**, long-text support, MP3 / WAV / Opus output

### Input

| Field | Default | What it does |
|---|---|---|
| `text` | required | The text to read |
| `language` | `Auto` | Language of the text |
| `voice` | `Vivian` | Preset speaker (ignored when cloning) |
| `instruct` | — | Style note, e.g. "sound excited and energetic" |
| `ref_audio_url` | — | Link to the voice you want to clone |
| `ref_text` | — | Transcript of that clip — improves cloning quality |
| `speed` | `1.0` | Playback speed |
| `format` | `wav` | `wav`, `mp3` or `opus` |

### Output

One dataset row per run: audio URL, duration, language, voice or clone, processing time.

### Pricing

No rental fee — you only pay Apify compute.

### Notes

- **Vietnamese is not supported here** — use the Vietnamese Text to Speech Actor.
- Only clone voices you own or have permission to use.

# Actor input Schema

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

Required text to synthesize. Long text is split at sentence boundaries. Maximum 20,000 characters. Vietnamese is not supported by the trained model.

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

Officially supported languages. Vietnamese is not trained in this model.

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

Speaker name from the CustomVoice checkpoint, e.g. Vivian, Ryan. Ignored when a reference clip is given.

## `instruct` (type: `string`):

Natural-language delivery hint, e.g. 'speak slowly and warmly'.

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

URL or path of a short reference clip. Switches to the Base checkpoint for zero-shot cloning.

## `ref_text` (type: `string`):

Exact transcript of the reference clip. Without it, cloning falls back to speaker-embedding-only mode (lower quality).

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

Speech rate multiplier. 1.0 is the natural pace of the voice.

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

Container/codec of the returned audio file.

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

Upper bound on generated audio tokens per chunk; higher values allow longer speech.

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

Smaller chunks keep CPU latency predictable for this autoregressive model.

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

Keep at 1 on CPU: the model already saturates all cores.

## Actor input object example

```json
{
  "text": "Hello, this is Qwen3 text to speech running on Apify.",
  "language": "Auto",
  "voice": "Vivian",
  "speed": "1.0",
  "format": "wav",
  "max_new_tokens": 2048,
  "chunk_chars": 200,
  "chunk_parallel": 1
}
```

# 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": "Hello, this is Qwen3 text to speech running on Apify."
};

// Run the Actor and wait for it to finish
const run = await client.actor("andrew_babo/qwen3-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": "Hello, this is Qwen3 text to speech running on Apify." }

# Run the Actor and wait for it to finish
run = client.actor("andrew_babo/qwen3-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": "Hello, this is Qwen3 text to speech running on Apify."
}' |
apify call andrew_babo/qwen3-tts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andrew_babo/qwen3-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/Kpny2J7EiPyGHFShs/builds/pAy6slWcOOJLWVhSu/openapi.json
