Extract audio segment start beyond video length: error and fix

Audio detach fails detach_start_past_source when range.start is past the probed duration. It differs from audio_detach_range_empty. Check duration first.

4 min readSume
All posts

detach_start_past_source means range.start is later than the video's actual length. It is raised by the worker after it probes the file, which is why a request with a normal-looking range can still fail it. audio_detach_range_empty is a different mistake: range.end at or before range.start, or a range longer than 900 seconds.

Codes are from the audio detach docs, read 2026-10-01. HeyGen's Speech Cleanup post, read the same day, describes removing filler words, pauses and retakes from a recording; if you are pulling out audio ranges for a similar job, check them against the clip length first.

How do the two range errors differ?

Both involve range, an optional { start, end? } in seconds. end is open-ended when omitted, and omitting range takes the whole track.

Audio detach range errors, per the Sume docs read 2026-10-01.
CodeWhenWhere it is raised
audio_detach_range_emptyrange.end at or before range.start, or longer than 900 sRequest check
detach_start_past_sourcerange.start past the probed durationWorker
detach_source_has_no_audioSource has no audio trackWorker
source_duration_exceededSource longer than 1800 sWorker

How do I find the clip length first?

Run video inspect with frames: false, which the detach docs say is enough to read probe.has_audio, and read the probed duration before choosing a range. A finished detach also reports source_duration_seconds, so you can compare after the fact. If your start is past the end, correct it or take the whole track by leaving range out.

What does a valid range request look like?

Output is capped at 900 seconds, so a whole track past 900 s needs a range anyway.

curl -X POST https://api.sume.com/v1/audio-detach \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: detach-range-001" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
    "range": { "start": 30, "end": 90 }
  }'

What if I only know the start?

Leave end off and the range runs to the end of the track, up to the 900-second output cap. See audio detach range over 900 seconds for the other end of the limit.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume