Content Studio
Narration
Turn a PDF or DOCX into a narrated audiobook, optionally translated first.
document.narrate reads a PDF or DOCX aloud with a natural voice and returns one merged audio file, word timestamps and a subtitle file per page. Set targetLanguage to translate the text before it is narrated.
| Operation | Input | Credits | Result files |
|---|---|---|---|
| document.narrate | PDF or DOCX, up to 50 MB | 80 credits per narrated page | audio, timestamps, srt_page_N |
Input
uploadIdstringrequiredUpload of a PDF or DOCX document.
sourceLanguagestringoptionaldefault: EnglishLanguage the document is written in.
targetLanguagestringoptionalNarrate in this language instead. The text is translated before narration.
voicestringoptionaldefault: EnceladusA Gemini voice name such as Enceladus, Kore, Aoede, Charon, Fenrir or Puck. Unknown voices are rejected.
tonestringoptionaldefault: professionalNarration style.
accentPromptstringoptionalUp to 500 characters describing the accent or delivery.
outputFormatstringoptionaldefault: mp3Format of the merged audiobook.
Code Example
curl -X POST https://api.transpera.io/v1/jobs \
-H "authorization: Bearer tp_test_..." \
-H "content-type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"operation": "document.narrate",
"input": {"uploadId": "UPLOAD_ID", "targetLanguage": "Hindi", "voice": "Kore", "outputFormat": "mp3"}
}'Result
Result of a finished document.narrate job
{
"job": {
"id": "JOB_ID",
"operation": "document.narrate",
"status": "succeeded",
"chargedCredits": 240,
"result": {
"type": "files",
"text": null,
"files": [
{
"role": "audio",
"fileName": "full_audiobook.mp3",
"url": "https://...",
"expiresAt": "..."
},
{
"role": "timestamps",
"fileName": "full_audiobook.json",
"url": "https://...",
"expiresAt": "..."
},
{
"role": "srt_page_1",
"fileName": "page_1.srt",
"url": "https://...",
"expiresAt": "..."
}
]
}
}
}