Skip to main content
adapt.auto_cut_down shortens (or lengthens) a piece of music to a length you choose, cutting at points that sound natural instead of fading out mid-phrase. Use it to fit a track to a 30-second advert, a 15-second social clip, or the length of a voiceover.

The request

Every field, with its exact rules: submit and poll in the API Reference.

Example

This cuts a track down to 30 seconds for an advert, normalised for streaming. It uses the reference client; save soundpiece.py or soundpiece.mjs next to it first.

The result

run returns the finished auto_cut object:

Choosing parameters

  • target_duration is a target, not an exact length. The cut lands near it, on a natural boundary. If you need an exact length (to the frame), trim or pad the result yourself afterwards.
  • It can lengthen too. A target longer than the source makes a longer version, up to twice the source’s length.
  • Loudness is off unless you include the block. Add it when the cut is going straight to a platform; it costs nothing extra. See the loudness normalisation guide for which target to pick.

Errors

When you submit (the request is refused, nothing is charged): While processing (the operation finishes as failed, with an error.code): Source limits for this endpoint: WAV, MP3 or FLAC, from 2.5 seconds to 5 minutes long, and at most 50 MB. The minimum is higher than elsewhere because the shortest cut, 5 seconds, needs a source at least half that long. See Errors for the response shapes, and for the errors every endpoint can return (401, 403, 429).

Cost

1 credit per request, with or without normalisation. Resending a request with the same idempotency key is not charged again.