Text to speech for long text and audiobooks: split and join
Split long text or a book under the TTS request limits, voice every chunk with the same settings, then join the audio into files of up to 30 minutes.

To turn long text into speech, split it at paragraph or sentence breaks into chunks that fit one request, synthesize every chunk with the same voice and settings, then join the audio in order. On Sume, one text to speech request takes up to 20,000 characters and must produce no more than 1,200 seconds of audio, and a Timeline audio concat joins up to 20 parts, with no gaps, into one file of up to 1,800 seconds (30 minutes).
The limits come from the TTS schema in the Sume API reference, the OpenAPI document behind the API reference docs, and the Timeline audio docs, read on 2026-09-27. Behavior described as current is read from Sume's code, and the price from the code behind API pricing. For a single request, see Text to speech API.
What are the limits for one request and one file?
A chunk has to pass two separate caps: the character cap on the text you send, and the duration cap on the audio that comes back. Plan one joined file per chapter, or per half hour of audio.
| Limit | Value |
|---|---|
| Text per TTS request | transcript of 1–20,000 characters; spaces and punctuation count. |
| Audio per TTS request | 1,200 seconds. Longer fails with tts_duration_exceeded, and no credits are captured. |
| Parts per Timeline audio concat | 1–20, in order, all sharing one channel layout. |
| Audio per joined file | 1,800 seconds. |
| Concat inputs | Your workspace's media.sume.com audio, such as TTS output. |
How should I split the text?
- Cut at paragraph breaks, and at sentence breaks when a paragraph is too long, so no sentence is split between two chunks.
- Sume documents no characters-per-second rate, so measure. With
timestamps: { "words": true }, the current code addsduration_secondsto the result: synthesize the first chunk, then size the rest from its seconds per character. - A chunk that fails with
tts_duration_exceededcaptures no credits. Split it and send the halves. - Extract the text from a PDF or e-book first.
transcriptis plain text to synthesize.
How do I synthesize each chunk?
Send one POST /v1/tts-1.0/generate per chunk and keep everything but the text identical: the same voice, language, output_format, and generation_config. Ask for WAV (pcm_s16le), since the chunks will be joined.
Give each chunk its own Idempotency-Key, such as book-ch03-part02. A retry with the same key and body returns the original job with idempotency_hit: true instead of a second paid job.
curl -X POST https://api.sume.com/v1/tts-1.0/generate \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: book-ch03-part02" \
-d '{
"transcript": "Chapter three. The rain had not stopped for a week...",
"avatar_handle": "acme_narrator",
"language": "en",
"output_format": { "container": "wav", "encoding": "pcm_s16le", "sample_rate": 44100 },
"timestamps": { "words": true }
}'How do I join the chunks into one audio file?
When the chunks are done, send their audio URLs in reading order to POST /v1/timeline-1.0/audio with operation: "concat" and an Idempotency-Key, which this route requires. The join is sample-domain: no re-synthesis and no silence added at the seams. Poll GET /v1/jobs/:id/status and GET /v1/jobs/:id/result; the result carries one audio_url, its duration_seconds, and segments[] with the start of every part, which you can use as section markers.
The output is WAV (pcm_s16le) by default. mp3 is smaller but re-adds priming padding at every edge, so request it only for a final file you won't join again.
curl -X POST https://api.sume.com/v1/timeline-1.0/audio \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: book-ch03-join" \
-d '{
"operation": "concat",
"parts": [
{ "url": "https://media.sume.com/artifacts/artf_demo/ch03-part01.wav" },
{ "url": "https://media.sume.com/artifacts/artf_demo/ch03-part02.wav" },
{ "url": "https://media.sume.com/artifacts/artf_demo/ch03-part03.wav" }
]
}'What does long text to speech cost?
Speech is billed per transcript character at $0.0475 per 1,000 characters, plus a 5.5% agent fee by default, so a 100,000-character manuscript comes to about $4.75 of speech before the fee. Each concat is billed per job, at the rate on the Timeline audio page, which says to confirm it in GET /v1/catalog.
What doesn't this workflow handle?
- A whole book in one file. A joined file tops out at 1,800 seconds, so a long book becomes a set of files.
- Pauses and crossfades. Concat plays the parts back to back with no silence added, so any pause between chunks is the silence the clips already carry.
- Publishing. The workflow ends at the audio files; check your distributor's file requirements before you upload.
Sources
Related posts
More in Use cases
- Text to speech with multiple voices: one voice per line
A TTS request speaks with one voice. For a dialogue, synthesize each speaker's lines in that speaker's voice, then join the clips in script order.
- Virtual try-on video API: put a garment on a person
Make a virtual try-on video with the Sume API: call sume-virtual-try-on or sume-virtual-fitting with photos, or make a still and animate it.
- How to get a white background product photo with AI
Cut the product out with a background remover and flatten the PNG onto white, or have an image model re-render the shot on white. Both with Sume.
- AI album cover generator: square art at 3000×3000
Generate square album art, then upscale: Apple recommends at least 3000×3000. On Sume, generate 2400×2400 and upscale it 1.25× to reach 3000×3000.
Written by Sume