How to fix audio delay in a video by shifting the sound
Fix a video whose sound runs late or early: detach the audio and re-render the clip with the offset set as audio.source_in or the slot's source_in.

To fix audio delay in a video, shift the two tracks back into line and save a new file: if the sound comes late, cut the delay off the start of the sound; if it comes early, cut it off the start of the picture. With Sume, when the clip is already hosted on Sume, detach its audio and render the clip over it in Timeline 1.0, with the delay as audio.source_in for late sound or as the slot's source_in for early sound.
The facts come from the Timeline 1.0 and Audio detach docs and the field descriptions in the Sume API reference, read on 2026-09-27. Anything described as current behavior is read from Sume's code.
Is the delay in the file or in the player?
Check before you edit. If the same file plays in sync in another player, the delay comes from playback, and a new render will not change it. The fix below is for a file whose sound is off by the same amount from start to end. If the gap grows over the clip, a single shift lines up only one point.
Measure the offset yourself at a sharp moment, such as a clap or a hard consonant: note when it is seen and when it is heard. The difference is the delay d in seconds.
How do I shift the audio with Sume?
The clip must already be your workspace's media.sume.com artifact or asset, such as an earlier Sume job's output; Sume has no public upload route for a file on your computer (which URLs each endpoint accepts). Detach its audio with POST /v1/audio-detach. The default output is a sample-exact wav, the file a Timeline audio.url wants, and the result reports its duration_seconds. Then render the clip over that wav with the delay in one of two fields:
| The sound is… | Set | Output length |
|---|---|---|
| Late: heard after it is seen | audio.source_in: d, the in-point into the spine file | The wav's duration_seconds minus d |
| Early: heard before it is seen | video[0].source_in: d, the in-point into the clip | The clip's length minus d |
curl -X POST https://api.sume.com/v1/timeline-1.0/render \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: resync-clip-001" \
-d '{
"audio": {
"url": "https://media.sume.com/artifacts/artf_demo/clip.wav",
"source_in": 0.3,
"duration_seconds": 59.7
},
"output": { "width": 1920, "height": 1080 },
"video": [
{ "source_url": "https://media.sume.com/artifacts/artf_demo/clip.mp4", "start": 0, "duration": 59.7 }
]
}'What can make the shifted render go wrong?
The example fixes a 60-second clip whose sound is 0.3 s late. These rules keep it valid:
audio.source_inworks on a singleaudio.urlspine. The output still runsduration_seconds, so the file must holdsource_in + duration_seconds, or the render failsaudio_source_in_exceeds_source.- For early sound, drop
audio.source_inand give the slotsource_in: 0.3instead. Keep the slot'ssource_inplusdurationwithin the clip, because a slot that runs past its clip is filled byrender.pad_mode. - The default output is 1080×1920, so set
outputto the clip's size. - In the current compiler a render's sound comes only from its spine and an optional soundtrack, so the clip's old, out-of-sync track is not mixed back in.
What does the fix cost, and what does it cut?
The new video is d seconds shorter. For late sound, the first d seconds of sound and the last d seconds of picture are dropped; for early sound, it is the other way around. Each step bills on its own, plus a 5.5% agent fee by default. Detach bills per job at the rate in GET /v1/catalog, and the render reserves $0.10 per output minute on API pricing, counted as ceil(audio.duration_seconds / 60) minutes; it never charges more than its reservation.
To replace the sound instead of shifting it, see replace or remove the audio in a video.
- Detach reads sources up to 1,800 s and writes at most 900 s. For a longer clip, detach two
ranges and pass them asaudio.parts[]. For late sound, put the delay on the first part's ownsource_in: a top-levelaudio.source_inwithpartsis refused withaudio_source_in_requires_single_spine. - A render outputs 1 to 1,800 seconds.
Sources
Related posts
More in Media tools
- How to freeze frame a video: hold the last or any frame
Freeze a video's last frame with one tpad filter call, or hold any frame mid-clip as a still between two parts of the clip in a Timeline render.
- How to generate an SRT file from a video
To generate an SRT file from a video, transcribe it with timestamps and write each timed sentence as a numbered block. Sume's STT returns timed JSON.
- Hard subtitles vs soft subtitles: what's the difference?
Hard subtitles are burned into the picture and always show; soft subtitles are a separate track viewers can turn off. When to use each, and how.
- How to check a video's bitrate from its size and length
Check a video's average bitrate: size in bytes × 8 ÷ length in seconds. Sume's free probe returns both numbers, size_bytes and duration_seconds.
Written by Sume