Cut a 30-second hook from a video's audio: detach with a range

Pull just seconds 45 to 75 of a Sume-hosted video as a mono mp3 with POST /v1/audio-detach and range. Source and output caps, price and refusals.

5 min readSume
All posts

How do you extract a short section of a video's audio? Call POST /v1/audio-detach with a video_url and a range of { start, end } in seconds, and ask for format: "mp3" if you want a small file. The docs say it takes one workspace media.sume.com video and returns a new audio artifact, leaving the video untouched.

The default format is sample-exact wav, mp3 is 128 kbps, and channels can be source or mono. A whole track longer than 900 seconds needs a range, since the output cap is 900 seconds.

The request

Idempotency-Key is required and video_url must be this workspace's media.sume.com file; off-host URLs are rejected, so import first with POST /v1/media-imports. mode: "sync" waits up to 30 seconds.

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

Options and caps

Docs.sume.com Audio detach, read 2026-10-04.
FieldRule
formatwav default, or mp3 at 128 kbps
range{ start, end? } seconds; end open-ended when omitted
channelssource default, or mono
sample_rate16000, 44100 or 48000; omit to inherit
Source lengthUp to 1800 seconds
Output lengthUp to 900 seconds

Read the result

When the job is ready, GET /v1/jobs/:id/result returns kind: audio_detach with audio_url, duration_seconds, format, channels, sample_rate, source_duration_seconds and optional warnings[]. There is no GET /v1/audio-detach/:id; poll the job envelope instead. The public rate is $0.01 per job.

Common refusals

A source with no audio fails detach_source_has_no_audio; check probe.has_audio with video inspect first. A start past the end fails detach_start_past_source, and an end at or before start fails audio_detach_range_empty. ffmpeg-style fields such as filter or codec are rejected with ffmpeg_fields_rejected, because the server compiles ffmpeg itself.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume