Skip to content

For AI agents: every API docs page in one plain-text file is at /docs/llms-full.txt, and the documentation index is at /llms.txt. This page is available as Markdown at https://diffio.ai/docs/developers/guides/edit-transcript.md, and every docs URL returns Markdown when requested with Accept: text/markdown.

Edit a transcript and re-render the audio

Change a word in a Pro result's transcript and get back the whole recording with the new word said in the same voice.

How it works

  1. Your code → Diffio API: POST /projects, model diffio-pro
  2. Diffio API → Your code: generation complete, transcript_editable: true
  3. Your code → Diffio API: GET …/transcript, words with id, text, start, end
  4. Your code: change words, text, changed: true
  5. Your code → Diffio API: POST …/edits/estimate, max_billable_seconds
  6. Your code → Diffio API: POST …/edits, Idempotency-Key
  7. Diffio API → Your code: generation, kind "edit", complete (or generation.completed)
  8. Your code → Diffio API: GET …/media, files.audio of the edit
One changed word restores one window; the rest of the recording is kept as it was.

Build it

  1. 1

    Restore with Pro

    Only a finished diffio-pro result can be edited (transcript_editable is true). The transcript can arrive a moment after the audio: wait while transcription_status is preparing, for a bounded time, and show the generation's error when it fails.

  2. 2

    Change the words

    Read the transcript and send every word back, in order. Change a word's text and mark it changed; text: "" removes a word.

  3. 3

    Estimate first

    edits.estimate creates and bills nothing. Each restored window bills 30 seconds; max_billable_seconds is the most this edit can bill.

  4. 4

    Create the edit and wait

    The edit is a new generation with kind: "edit"; only the windows around changed words are restored again. A fixed Idempotency-Key makes a retry return the same edit and bill it once.

  5. 5

    Download the edited recording

    The edit's media is the whole recording with the new words in it.

The complete script

Put interview.mp3 next to it and name the word to replace and its replacement.

What you get

on the ground of scientific historical (changed: true) evidence, or in the end on the ground of any evidence whatever.

Words from the Recording rescue lecture as an edit sends them: every word in order, one replaced and marked changed. Only the window around it is restored again.
  • interview-restored.mp3: the Pro restore.
  • interview-edited.mp3: the same recording with the word replaced, from a generation of kind edit.
Output of python edit.py Tuesday Thursday
Terminal
1 change(s), at most 30 billable seconds
saved interview-edited.mp3 from generation 9d1f4c2a-5b7e-5c3d-8a6f-2e4b1c0d9f87 kind edit

API reference

  • GETGet a generation's transcript (/projects/{project_id}/generations/{generation_id}/transcript): Words with ids and timings.
  • POSTEstimate a transcript edit (/projects/{project_id}/generations/{generation_id}/edits/estimate): The most an edit can bill.
  • POSTEdit a generation's transcript (/projects/{project_id}/generations/{generation_id}/edits): Word fields, refusals and billing.
  • GETGet a generation (/projects/{project_id}/generations/{generation_id}): Status and progress of the edit.
  • GETGet a playback grant (/projects/{project_id}/generations/{generation_id}/media): The edited files.

Report an issue with this page