Free AI Text-to-Speech Service

Convert your text to natural AI speech with our fast web app and powerful API. Enjoy unlimited free usage for websites, apps, and projects — SEO-friendly and easy to integrate!

0 / 5000 characters

Service Overview

How to Use (GUI)

  1. Enter text (up to 5000 characters).
  2. Choose a voice.
  3. Click "Generate Speech".
  4. Wait for the status update (Queued, Processing, Completed).
  5. Listen using the player or download the WAV file.

Key Benefits

  • 🚀 Efficient Queuing: Handles requests sequentially, avoids duplicate work.
  • 💰 Free Usage: Generous free tier for generating speech.
  • 🔊 Standard Format: Provides audio in high-quality WAV format.
  • 💾 Direct Download: Easy saving of generated audio.
  • ⚙️ Developer API: Simple API (POST/GET) for integration (POST Recommended).
  • Clean & Accessible: User-friendly interface.

API Access & Integration

API Features

  • Accepts POST (Recommended) or GET requests to index.php?api=1.
  • Requires text and voice (male/female) parameters. Send in POST body (form-data/x-www-form-urlencoded) or GET query string.
  • The same request handles both job submission (if text/voice is new) and status polling (if text/voice already exists).
  • Returns JSON response detailing job status (queued, processing, completed, failed).
  • Includes queue_position (jobs ahead) for queued status.
  • Provides full output_urlpath upon completion.
  • Uses a hash (10-char SHA1) for identification and de-duplication.
  • Returns HTTP 201 Created for newly created jobs, 200 OK when polling or finding existing jobs.
  • Returns standard HTTP error codes (400, 500) with JSON error messages.
Warning: Using GET is supported but not recommended due to:
  • URL Length Limits: Long text will likely fail.
  • Caching: May return stale status results.
  • Security: Text appears in URLs and server logs.
  • REST Practice: GET should not create/modify server state.
Please prefer POST for all API interactions.

Note: This API endpoint requires a separate background worker process to actually process the 'queued' jobs.

API Usage Examples

Send POST or GET requests to http://experimentaldata.co.uk/text_to_speech/?api=1 with text and voice parameters.

Example: Submit/Poll Job (cURL using POST - Recommended)

curl -X POST \
  'http://experimentaldata.co.uk/text_to_speech/?api=1' \
  -F 'text=This is a POST API test.' \
  -F 'voice=female'

(Polling uses the exact same POST request.)

Example: Submit/Poll Job (Using GET - Not Recommended)

http://experimentaldata.co.uk/text_to_speech/?api=1&text=Hello+world!&voice=male

(Warning: Subject to URL length limits and other issues mentioned above.)

Expected JSON Response Structure (Success):

{
    "id": 125,
    "hash": "a1b2c3d4e5",
    "text": "This is an API test.",
    "voice": "female",
    "status": "completed",
    "created_at": "2023-10-28 11:30:00",
    "updated_at": "2023-10-28 11:30:05",
    "processing_started_at": "2023-10-28 11:30:02",
    "error_message": null,
    "output_urlpath": "https://yourdomain.com/text_to_speech/output/a1b2c3d4e5.wav",
    "queue_position": 0
}

Expected JSON Response Structure (Client Error):

{
    "status": "error",
    "message": "Parameter 'text' cannot be empty."
}

Frequently Asked Questions

What audio format is used?

The service generates audio files in the standard WAV format.

Are there limits on the text length?

Yes, the current limit is 5000 characters per request. For longer texts, please submit them in multiple parts. Using the API via GET may impose lower practical limits due to URL length restrictions.

How long are generated audio files kept?

There is no guaranteed retention period. Files may be removed periodically. Please download your generated audio promptly.

Why does the API support GET if POST is recommended?

While GET is supported for flexibility, POST is strongly recommended for API interactions. Using POST aligns with web standards for submitting data or requesting actions that change state (like creating a job queue entry). It also avoids issues with URL length limits, browser/proxy caching, and prevents sensitive text from appearing directly in URLs or server logs.

How is the processing actually done?

This PHP script acts as the API endpoint and queue manager. A separate, independent background worker script/service (not included) handles the actual audio generation using a TTS engine and updates the job status in the database.

Disclaimer: Use responsibly. This is a free service with limitations. Audio quality depends on the backend TTS engine. Do not submit sensitive data. Generated files are not guaranteed permanent storage.