Cut a 90 s music window: timeline-audio split and range end errors

Use timeline-audio split with ranges [{start, end}] to cut a window. end must exceed start or you get audio_range_end_before_start; omit end for the rest.

4 min readSume
All posts

To cut a 90 second window from a longer audio file with Sume, send POST /v1/timeline-1.0/audio with operation: "split", the file url, and ranges: [{ "start": 30, "end": 120 }]. If a range has end less than or equal to start, you get audio_range_end_before_start and the hint fix_range_bounds. Omit end to run to the end of the file.

The 90 second figure is not arbitrary. YouTube says most songs can be used for up to 90 seconds in a three-minute Short, with some at 60 or 30 seconds (YouTube Help, read 2026-10-05). That limit applies to music used through YouTube's own tools, so a cut like this is a production step, not a rights decision.

The request

The split operation takes a top-level url and one to 20 ranges. Ranges may overlap, and each returns its own audio_url in segments[]. The output is wav by default, which is sample-exact, or mp3 through output.format, which adds priming padding at each edge. It costs $0.01 per job in the public pricing constant. Send an Idempotency-Key and poll GET /v1/jobs/:id/status, because there is no GET route on the audio path.

{
  "operation": "split",
  "url": "https://media.sume.com/artifacts/artf_demo/track.wav",
  "ranges": [{ "start": 30, "end": 120 }]
}

Errors in this route

Most failures are shape mistakes, and each has a stable code from the timeline audio docs.

timeline-audio split refusals (Sume docs read 2026-10-05)
MistakeCode
end is at or before startaudio_range_end_before_start
split without urlaudio_split_requires_url
split without rangesaudio_split_requires_ranges
parts sent with splitaudio_split_takes_no_parts
ranges outside 1 to 20 entriesschema refusal

A Python check for your ranges

The check below catches the end-before-start mistake locally, for example when a range is built from a beat timestamp minus a lead-in. It adds nothing the API does not already enforce, but it saves a round trip.

def bad_ranges(ranges):
    return [r for r in ranges if "end" in r and r["end"] <= r["start"]]

print(bad_ranges([{"start": 30, "end": 120}, {"start": 90, "end": 60}]))

Reading the result

The result is kind: timeline_audio with a segments[] list. Each segment carries its own audio_url, and the produced audio is at most 1800 seconds. For a 90 second window, check that the returned duration_seconds is about 90 before you use the file as audio.url in a Timeline 1.0 render, where the same value goes into audio.duration_seconds. If you want several windows, for example a 30, a 60 and a 90 second cut for platforms with different limits, put them all in one ranges array and pay for one job.

When not to use this

Splitting the audio is only half of a platform music rule. YouTube also says a Short over one minute with an active Content ID claim is blocked and cannot be monetized, and royalty-free tracks in its Audio Library do not get claims. Cutting a track shorter does not clear a claim. If you want a bed that is made for the clip, Sume's music docs describe the generated option. For the audio of a video file, use audio detach first, then split.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume