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_sampleint00set number of first sample to start fading
nb_samplesint441001set number of samples for fade duration
start_timeint00set time to start fading
durationint00set fade duration
curveAfadeCurvetrinofade, tri, qsin, esin, hsin, log, ipar, qua, …set fade curve type
silencefloat001set the silence gain
unityfloat101set the unity gain

FFmpeg also names these options (use the parameter shown above): ttype, ssstart_sample, nsnb_samples, ststart_time, dduration, ccurve.


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.