Skip to content

Afade

Audio Single output Transform

Fade in/out input audio.

FFmpeg filter: afade — the official reference.

Add it to a graph. The explicit form works for every filter — bind it to its input and read the result from outputs():

$node = $audio->addFilter(new Afade(…));
$result = $node->outputs()[0];

Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:

$result = $audio->apply(new Afade(…));

TODO — when this filter shines: what it’s the right tool for, what to reach for instead when it isn’t, and how it composes with neighbouring filters.

TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).

TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.

TODO

TODO

ParameterTypeDefaultRange / valuesDescription
typeAfadeTypeinin, outset the fade direction
start_sampleint0≥ 0set number of first sample to start fading
nb_samplesint44100≥ 1set number of samples for fade duration
start_timeint0≥ 0set time to start fading
durationint0≥ 0set fade duration
curveAfadeCurvetrinofade, tri, qsin, esin, hsin, log, ipar, qua, …set fade curve type
silencefloat00–1set the silence gain
unityfloat10–1set the unity gain

FFmpeg also names these options (use the parameter shown above): t → type, ss → start_sample, ns → nb_samples, st → start_time, d → duration, c → curve.


Maps to FFmpeg’s afade filter. Verified against ffmpeg n7.1.1.

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.