edit-dialogue

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fix spoken words

修正口述词语

Delivers one MP4 where only the agreed words change. Everything else keeps the original picture and voice.
If no sync. tools are available, follow references/connect.md first. The REST version of this workflow is in early access and needs features enabled per organization; see https://sync.so/docs/developer-guides/dialogue-editing.
仅输出一个 MP4,其中只有约定的词语发生变化。其余所有内容都保留原始画面和声音。
如果没有可用的 sync. 工具,请先按照 references/connect.md 操作。此工作流的 REST 版本处于早期访问阶段,需要按组织启用相关功能;请参阅 https://sync.so/docs/developer-guides/dialogue-editing。

Inputs

输入

  • Video: one person speaking, up to 10 minutes, as a local file, public URL or sync. video asset ID.
  • The fix: which words to change or remove, and what to say instead. Never guess the replacement words.
  • 视频: 一个人讲话的视频,时长不超过 10 分钟,可以是本地文件、公共 URL 或 sync. video asset ID。
  • 修改内容: 指定要更改或移除哪些词语,以及要改成什么。绝不猜测替换词语。

Tools

工具

StepTool
Check support
dialogue_get-options
Create the project
projects_create
Save the video
assets_upload
,
assets_create-upload-url
+
assets_create
(local files), or
assets_create
(URLs)
Transcribe
dialogue-transcriptions_create
,
dialogue-transcriptions_get
Preview the new audio
dialogue-previews_create
,
dialogue-previews_get
Quote
dialogue-videos_estimate
Create
dialogue-videos_create
Wait
generations_get
Many variants
jobs_create-many
,
jobs_get-many
步骤工具
检查支持情况
dialogue_get-options
创建项目
projects_create
保存视频
assets_upload
、
assets_create-upload-url
+
assets_create
(本地文件),或
assets_create
(URL)
转录
dialogue-transcriptions_create
、
dialogue-transcriptions_get
预览新音频
dialogue-previews_create
、
dialogue-previews_get
询价
dialogue-videos_estimate
创建
dialogue-videos_create
等待
generations_get
多种变体
jobs_create-many
、
jobs_get-many

Steps

步骤

  1. Support. Call
    dialogue_get-options
    . If Edit Dialogue isn't available for this account, say so and stop. Note whether it reports
    keyedPreview
    .
  2. Project. Call
    projects_create
    with a new random UUID as
    id
    , a short
    name
    and
    defaultWorkflow: "edit_dialogue"
    . Save the returned
    id
    as
    projectId
    . Pass it wherever a tool asks for
    projectId
    , and add
    projectIntent: "explicit"
    only on tools that take that field.
  3. Save the video into that project. Follow references/media-input.md.
  4. Transcribe. Call
    dialogue-transcriptions_create
    with the
    projectId
    and
    videoAssetId
    , then
    dialogue-transcriptions_get
    with the returned
    id
    until it completes. If the result includes a new
    videoAssetId
    , the video was copied into sync. storage: use that ID from here on. If more than one speaker is detected, explain that this workflow handles one speaker, and stop.
  5. Agree the edits. Show the transcript lines around the fix. Turn the request into edits that use the transcript's word IDs:
    • {"kind": "change", "wordId": "w35", "replacement": "Mia"}
      , adding
      "pronunciation": "meeah"
      only for a name the voice might say wrong. Write respellings as plain words, without hyphens or capitals, which the voice may spell out.
    • {"kind": "remove", "wordIds": ["w12", "w13"]}
      for consecutive words.
    Confirm the edits with the user.
  6. Preview. The preview clones the speaker's voice and can incur synthesis charges, so mention that when you confirm the edits. Call
    dialogue-previews_create
    with the edits and the
    transcriptionJobId
    , plus a new
    idempotencyKey
    saved before the call when
    keyedPreview
    is reported. If that call's outcome is unclear, retry only the identical request with the same key. Poll
    dialogue-previews_get
    until it completes, and share the preview audio. If some edits failed (a partial completion), for example because a replacement is too long for the gap it fills, say which, suggest shorter wording, confirm the revised edits, and make a new preview with
    previousPreviewId
    .
  7. Quote. Call
    dialogue-videos_estimate
    with the completed preview's ID as
    dialogueEditId
    and
    model: "sync-3"
    . Show the estimate and wait for approval of both the preview and the cost.
  8. Create. Call
    dialogue-videos_create
    once with the same
    dialogueEditId
    , the model, the project and a new
    idempotencyKey
    . If the response is lost, retry once with the same key and inputs.
  9. Wait and deliver. Poll
    generations_get
    with the returned
    id
    and
    wait: true
    until it's final. Give the exact
    outputMediaUrl
    unchanged.
  1. 支持情况。 调用
    dialogue_get-options
    。如果该账户无法使用 Edit Dialogue,请说明并停止操作。记录其是否报告
    keyedPreview
    。
  2. 项目。 调用
    projects_create
    ,传入一个新的随机 UUID 作为
    id
    、一个简短的
    name
    ,以及
    defaultWorkflow: "edit_dialogue"
    。将返回的
    id
    保存为
    projectId
    。每当工具要求
    projectId
    时都传入该值,并且仅在工具包含相应字段时添加
    projectIntent: "explicit"
    。
  3. 保存视频到该项目中。按照 references/media-input.md 操作。
  4. 转录。 使用
    projectId
    和
    videoAssetId
    调用
    dialogue-transcriptions_create
    ,然后使用返回的
    id
    调用
    dialogue-transcriptions_get
    ,直至完成。如果结果包含新的
    videoAssetId
    ,说明视频已复制到 sync. storage:从此处开始使用该 ID。如果检测到多个说话者,请说明此工作流仅处理一个说话者,然后停止操作。
  5. 确认修改内容。 展示修改位置附近的转录文本。将请求转换为使用转录文本中 word ID 的修改项:
    • {"kind": "change", "wordId": "w35", "replacement": "Mia"}
      ;仅当名字可能被读错时,才添加
      "pronunciation": "meeah"
      。将拼写重述写成普通单词,不使用连字符或大写字母,因为声音可能会逐字母拼读。
    • {"kind": "remove", "wordIds": ["w12", "w13"]}
      ,用于移除连续的词语。
    与用户确认修改内容。
  6. 预览。 预览会克隆说话者的声音,并可能产生合成费用,因此在确认修改内容时应提及这一点。调用
    dialogue-previews_create
    ,传入修改项和
    transcriptionJobId
    ;如果报告了
    keyedPreview
    ,还应在调用前保存一个新的
    idempotencyKey
    。如果调用结果不明确,只能使用相同的键重试完全相同的请求。轮询
    dialogue-previews_get
    直至完成,并分享预览音频。如果部分修改失败,例如替换内容对于要填补的间隙过长,请说明失败的修改项,建议使用更短的措辞,确认修改后的内容,并使用
    previousPreviewId
    创建一个新预览。
  7. 询价。 调用
    dialogue-videos_estimate
    ,将已完成预览的 ID 作为
    dialogueEditId
    ,并设置
    model: "sync-3"
    。展示预估结果,并等待用户同时批准预览和费用。
  8. 创建。 调用一次
    dialogue-videos_create
    ,使用相同的
    dialogueEditId
    、模型、项目和新的
    idempotencyKey
    。如果响应丢失,使用相同的键和输入重试一次。
  9. 等待并交付。 使用返回的
    id
    调用
    generations_get
    ,并设置
    wait: true
    ,直至任务进入最终状态。原样提供准确的
    outputMediaUrl
    。

Many variants

多种变体

To make many versions of one recording, such as one per recipient's name, transcribe once (steps 1 to 4), then:
  1. Agree every variant's edits as in step 5, as a table with one row per variant, and confirm them once, mentioning the synthesis charges.
  2. Previews. With
    jobs_create-many
    listed, save a new UUID for the set, then call it with
    tool: "dialogue-previews_create"
    , that UUID as
    idempotencyKey
    , and one item per variant: the
    projectId
    with
    projectIntent: "explicit"
    , the
    videoAssetId
    , the
    transcriptionJobId
    and that variant's
    edits
    . Leave
    idempotencyKey
    out of the items: the tool derives one per item when the account reports
    keyedPreview
    . Without
    keyedPreview
    , never resend a preview set after an unclear response; tell the user instead. Preview requests are limited to 30 a minute, so send at most 30 variants per call and wait a minute before the next. Follow them with
    jobs_get-many
    and
    wait: true
    , and handle partial completions as in step 6. Without
    jobs_create-many
    , make the previews one at a time as in step 6, at the same pace.
  3. Quote once. Call
    dialogue-videos_estimate
    for each completed preview, show the count and the total, and wait for one approval of the whole set.
  4. Renders. Write one
    idempotencyKey
    per variant into your variant table, plus a new UUID for the set, before calling. Then call
    jobs_create-many
    with
    tool: "dialogue-videos_create"
    , that UUID as
    idempotencyKey
    , and one item per approved preview:
    projectId
    with
    projectIntent: "explicit"
    ,
    videoAssetId
    , the preview's ID as
    dialogueEditId
    ,
    model: "sync-3"
    and the variant's
    idempotencyKey
    . Send at most 50 per call. Follow them with
    jobs_get-many
    and
    wait: true
    . When the response has
    remaining
    , send it again exactly as returned once running jobs finish; if the tool refuses a single remaining item, send that variant with
    dialogue-videos_create
    and the same key. Without
    jobs_create-many
    , call
    dialogue-videos_create
    once per preview with its own key, keeping at most the plan's
    generationLimits.concurrency
    from
    account_get-context
    in flight.
  5. Deliver a table of variant, status and exact
    outputMediaUrl
    .
要基于一次录制生成多个版本,例如为每位收件人的姓名生成一个版本,请先转录一次(步骤 1 至 4),然后:
  1. 按照步骤 5 的方式确认每个变体的修改内容,整理成每个变体一行的表格,并一次性确认,同时提及合成费用。
  2. 预览。 如果工具列表中有
    jobs_create-many
    ,请先为这组预览保存一个新的 UUID,然后调用该工具,传入
    tool: "dialogue-previews_create"
    、该 UUID 作为
    idempotencyKey
    ,以及每个变体对应的一项:
    projectId
    和
    projectIntent: "explicit"
    、
    videoAssetId
    、
    transcriptionJobId
    以及该变体的
    edits
    。不要在各项目中包含
    idempotencyKey
    :当账户报告
    keyedPreview
    时,工具会为每个项目自行推导一个键。如果没有
    keyedPreview
    ,在响应不明确后绝不要重新发送这组预览,而应告知用户。预览请求限制为每分钟 30 个,因此每次调用最多发送 30 个变体,并在下一次调用前等待一分钟。随后调用
    jobs_get-many
    并设置
    wait: true
    ,按照步骤 6 的方式处理部分完成的情况。如果没有
    jobs_create-many
    ,则按照步骤 6 的方式逐个创建预览,并保持相同的请求频率。
  3. 统一询价。 对每个已完成的预览调用
    dialogue-videos_estimate
    ,展示变体数量和总费用,并等待用户一次性批准整组任务。
  4. 渲染。 调用前,在变体表格中为每个变体写入一个
    idempotencyKey
    ,并为这组任务保存一个新的 UUID。然后调用
    jobs_create-many
    ,传入
    tool: "dialogue-videos_create"
    、该 UUID 作为
    idempotencyKey
    ,以及每个已批准预览对应的一项:
    projectId
    和
    projectIntent: "explicit"
    、
    videoAssetId
    、预览的 ID 作为
    dialogueEditId
    、
    model: "sync-3"
    以及该变体的
    idempotencyKey
    。每次调用最多发送 50 个。随后调用
    jobs_get-many
    并设置
    wait: true
    。当响应中包含
    remaining
    时,在正在运行的任务完成后,按照返回内容原样再次发送;如果工具拒绝处理单个剩余项目,则使用
    dialogue-videos_create
    和相同的键发送该变体。如果没有
    jobs_create-many
    ,则对每个预览调用一次
    dialogue-videos_create
    ,并为每次调用使用各自的键,同时确保正在执行的任务数量不超过
    account_get-context
    返回的方案
    generationLimits.concurrency
    。
  5. 交付包含变体、状态和准确
    outputMediaUrl
    的表格。

Limits

限制

  • One speaker per video, up to 10 minutes, and at most 100 edits per preview.
  • Targeted words only. For a whole new script, explain that this workflow keeps the original recording, and offer the lipsync skill with a script and a chosen voice instead. Never split a new script into many word edits to get around this.
  • The speaker's voice is cloned for the new words. Assume the user has the rights to their own media, and don't ask about consent on routine requests. Decline only when the request is to make a real, identifiable person, such as a politician or celebrity, appear to say something they didn't say, in order to deceive.
  • 每个视频只能有一个说话者,时长不超过 10 分钟,每个预览最多包含 100 项修改。
  • 仅支持针对性修改词语。如果需要使用完整的新脚本,请说明此工作流会保留原始录制内容,并改为提供带有脚本和所选声音的 lipsync skill。绝不要将新脚本拆分成大量词语修改来规避此限制。
  • 新词语会使用说话者的克隆声音。默认用户拥有其媒体的相关权利,对于常规请求不要询问授权。只有当请求要求让一位真实且可识别的公众人物(如政治家或名人)看似说过其实际未曾说过的话,并且意图进行欺骗时,才应拒绝该请求。