How to fade out audio at the end of a track

To fade out audio, lower the volume to silence over the last few seconds. Use FFmpeg's afade filter, or a Sume render for a track Sume made.

5 min readSume
All posts

To fade out audio, lower its volume gradually to silence over the last few seconds instead of letting it stop dead. You choose two numbers, where the track should end and how long the fade lasts, and the fade starts at the end time minus its length: a 5-second fade on a track that should end at 60 seconds starts at 55.

For a file on your computer, FFmpeg's afade filter does it in one command, as the FFmpeg filters documentation describes. For a track made by a Sume job, such as generated music or a voiceover, a Timeline 1.0 render applies the fade and Audio detach hands it back as a WAV or MP3. The Sume facts come from those pages and the Sume API reference, read on 2026-09-28.

How do I fade out an audio file with FFmpeg?

Use afade, FFmpeg's fade-in and fade-out filter. t=out picks the fade-out, st is the time it starts, and d is how long it lasts. FFmpeg's docs say that at the end of a fade-out the output is silence, and the default curve, tri, is a linear slope; curve picks another shape, such as log or qsin.

In the commands below, -af runs the filter on the audio, and -t, placed before the output file, stops writing once the output reaches that duration, so the file ends where the fade reaches silence instead of trailing on. Filters separated by a comma run one after the other, which is how the second command adds a fade-in.

MP3 is lossy, so every new MP3 encode is another lossy pass: edit in WAV and export MP3 last, as WAV vs MP3 explains.

# A song that should end at 60 s, with a 5-second fade-out
ffmpeg -i song.wav -af "afade=t=out:st=55:d=5" -t 60 song-faded.wav

# The same, plus a 3-second fade-in at the start
ffmpeg -i song.wav -af "afade=t=in:ss=0:d=3,afade=t=out:st=55:d=5" -t 60 song-faded.wav

How do I fade out a track made with Sume?

Render it through Timeline 1.0. Sume's join-and-split tool, Timeline audio, has no fade option: a split range is only a start and an end, a hard cut, as the jingle post notes. Every URL in a render must already be your workspace's media.sume.com file, such as the output of an earlier Sume job. Sume has no public upload route for a file on your computer, so use FFmpeg for those.

  • audio.mode: "silence" with audio.duration_seconds, from 1 to 1,800 seconds. The output always runs exactly this long, so a shorter value also cuts the track.
  • soundtrack.url is the track. With a silent spine the soundtrack is the whole audio track, so set gain_db to 0: omitted, it is −16 dB, a bed level.
  • soundtrack.fade_out_seconds, up to 10, fades the track over the last seconds of the output. The default, 0, stops it dead.
  • video[] needs one Sume-hosted still from 0 for the whole length. A still is held as a static frame; only the sound matters here.
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: song-fade-60s-001" \
  -d '{
    "audio": { "mode": "silence", "duration_seconds": 60 },
    "soundtrack": {
      "url": "https://media.sume.com/artifacts/artf_demo/song.mp3",
      "gain_db": 0,
      "fade_out_seconds": 5
    },
    "video": [
      { "source_url": "https://media.sume.com/artifacts/artf_demo/cover.png", "start": 0, "duration": 60 }
    ]
  }'

How do I get the faded track back as an audio file?

The render returns an MP4 at video_url. Send that URL to POST /v1/audio-detach, which takes one media.sume.com video and returns its sound as a new file at audio_url, leaving the video untouched. format is wav by default, pcm_s16le and sample-exact, or mp3 at 128 kbps. One detach returns at most 900 seconds, so a longer track needs a range per part.

Both calls need an Idempotency-Key and run as jobs: poll GET /v1/jobs/:id/status, then read GET /v1/jobs/:id/result.

curl -X POST https://api.sume.com/v1/audio-detach \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: song-fade-60s-detach-001" \
  -d '{ "video_url": "https://media.sume.com/artifacts/artf_demo/render.mp4", "format": "wav" }'

Can I fade in as well?

Yes. In FFmpeg, add afade=t=in before the fade-out, as in the second command above. In a Sume render, output.fade_in_seconds (0–5) fades the first seconds up from black and silence, per the API reference, and output.fade_out_seconds (0–5) fades the end down to black and silence; the two together must fit inside the output. These are the same edge fades that take a video in from black, as the video transitions post shows. The soundtrack itself has a fade-out field but no fade-in. For music that fades under a voice in a video instead, see Add background music to a video with an API.

What does it cost, and what are the limits?

The Sume route is two jobs, each listed at its own rate plus a 5.5% agent fee by default. The render reserves ceil(audio.duration_seconds / 60) minutes, so the 60-second example reserves one.

From Timeline 1.0, Audio detach, and API pricing, read 2026-09-28.
StepCallPriceLimits
FadePOST /v1/timeline-1.0/render$0.10 per output minute1–1,800 s of output; soundtrack fade 0–10 s; Sume-hosted URLs only
ExtractPOST /v1/audio-detach$0.01 per jobwav or mp3; up to 900 s of output per job

What can go wrong?

  • soundtrack_fade_exceeds_output: the fade is longer than the output.
  • unsupported_media_source: a URL that is not on the Sume media host.
  • Without loop, a track shorter than audio.duration_seconds stops partway through, and the render warns soundtrack_shorter_than_spine.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume