Redub Text-to-Speech API

POST /redub_tts

About this tool

`/redub_tts` merges synthetic speech with picture so product and education teams localize without booking talent for every wording tweak. Submit JSON tying `video_url` to a `script` block plus `voice_id` metadata understood by our TTS backends; FFmpeg composites the rendered waveform onto the mux while preserving captions-friendly timing cues. Tasks stay asynchronous behind the same polling contract, and multipart uploads remain off-limits: you publish finished audio by pointing at deterministic HTTPS assets when needed.

Compared to dumping MP3s into Slack, orchestrating synthesis through the API captures SSML quirks, pronunciation lexicons, and retry-friendly task IDs centrally. Tie each job to a subscription key whose usage charts show bursts during marketing pushes. Localization engineers often diff scripts in git, then automate hundreds of renders overnight with exponential backoff guarding rate limits. When multilingual campaigns collide, segregate workspaces per API key so finance can attribute Serbian versus Spanish spend without guesswork.

Expect minor drift between generated speech and embedded subtitles unless you rerun `/captions/auto` afterward. FFmpeg handles loudness leveling per documented presets, yet creative teams still spot-check consonants clipped by overly aggressive normalization. Consumers searching for gimmicky “instant voiceover generators” miss the governance story: ACLs around API keys, audit logs, and predictable spend caps.

Architecturally, synthesis plus muxing may take longer than simple cuts due to sequential CPU phases. Horizontal scale depends on tiers; bursting beyond contractual peaks queues jobs rather than starving neighbors. Observability dashboards mirror other routes, so Grafana hooks you already built for `/cut` reuse unchanged.

Security posture demands HTTPS everywhere: never embed raw credentials in payloads, and sanitize scripts to reject unexpected binary content. FFmpeg ignores HTML in strings, yet upstream validators should still constrain length so queue abuse stays impossible. Growth teams exporting CMS CSVs batch hundreds of renders by templating identical JSON scaffolding and swapping localized `script` fields per row, tying spreadsheet row IDs to returning task payloads so localization QA reconciles failures fast. Burst retries belong behind client-side leaky buckets so shared inference clusters stay humane.

Try it now

How it works

  1. Author the screenplay JSON

    Combine `video_url`, multi-line `script`, and chosen `voice_id`. Keep lines UTF-8 clean and cite public video locations only.

  2. POST with API authentication

    Send JSON to `/redub_tts` using your subscription API key headers. Responses omit giant blobs; they only expose task bookkeeping metadata.

  3. Monitor async FFmpeg + TTS stages

    Poll `status_url` for granular states distinguishing synthesis from final mux so product owners know which phase is slow.

  4. Download the voiced cut

    Grab the downloadable asset and route it through QA, caption regeneration, or `/merge_urls` packaging as needed.

Frequently asked questions

When should I use TTS instead of uploading a voice file?

Use this endpoint when you have a script and want synthesized speech muxed onto video. Upload a recorded voice file with the Audio Redub API instead.

How do I control pacing and pauses in the script?

Use punctuation and line breaks in the script field. Very long scripts may hit tier timeouts; split into multiple jobs for hour-long content.

Speech generated but the final video failed: what happened?

Task status shows separate stages for synthesis and muxing. Fix FFmpeg-related errors and retry; check docs on whether synthesis is cached for retries.

Do I need to regenerate captions after TTS?

Recommended for accessibility. Run auto captions on the final video so subtitles match the new narration.

Where do I find valid voice IDs?

See the API documentation for the current voice catalog. Invalid voice_id values fail validation before any synthesis runs.

Does TTS usage count toward my plan limits?

Yes. Character synthesis and encoding time both consume resources. Watch usage during large localization batches.

How do I use the Redub Text-to-Speech API?

POST to /redub_tts with a JSON body containing video_url, script, voice_id and your X-API-Key header. The API returns a task_id; poll GET /task/{task_id} until status is "completed" to retrieve the download_url.

Via the REST API

curl -X POST https://droidapps.one/redub_tts \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
         "video_url": "https://cdn.example.com/baseline.mp4",
         "script": "Welcome to tonight’s briefing…",
         "voice_id": "voice_en_neutral_v2"
       }'

Via the MCP server (droidapps-ffmpeg)

const job = await mcp.callTool("submit_job", {
  path: "/redub_tts",
  body: {
    video_url: "https://cdn.example.com/baseline.mp4",
    script: "Welcome to tonight’s briefing…",
    voice_id: "voice_en_neutral_v2"
  }
})
// Returns: { task_id: "abc123", status: "queued" }

const result = await mcp.callTool("wait_for_task", {
  task_id: job.task_id
})
// Returns: { status: "completed", download_url: "https://..." }