Overview
Process long text efficiently by automatically splitting it into chunks and combining the audio with pauses between segments. Ideal for long-form content like articles, books, or documentation.
Request Body
The text to convert to speech. Can be very long (10,000+ characters).
Language code (e.g., “en”, “es”, “fr”)
Pause duration in milliseconds between text segments
Example Request
curl -X POST https://api.gistmag.co.uk/tts/batch \
-H "Content-Type: application/json" \
-d '{
"text": "This is a very long text that will be automatically split into chunks...",
"language": "en",
"pause_duration": 800,
"api_key": "your_api_key_here"
}' \
--output output.mp3
How It Works
- Text is automatically split at sentence boundaries
- Each segment is processed independently
- Audio segments are combined with pauses between them
- Final audio is normalized and exported as MP3
Response
The response is a single MP3 audio file containing the complete text with natural pauses.
Content-Type: audio/mpeg
Content-Disposition: attachment; filename=output.mp3
Example Usage
Python
import requests
response = requests.post(
"https://api.gistmag.co.uk/tts/batch",
json={
"text": "Very long text here...",
"language": "en",
"pause_duration": 800,
"api_key": "your_api_key_here"
}
)
with open("output.mp3", "wb") as f:
f.write(response.content)
Voice Cloning with Batch
For batch processing with voice cloning, use the /tts/batch/voice-clone endpoint.
Batch processing is more efficient for long text as it handles chunking and combining automatically, ensuring natural pauses between sentences.