Skip to content

Afir

Audio Single output Transform

Apply Finite Impulse Response filter with supplied coefficients in additional stream(s).

FFmpeg filter: afir — the official reference.

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

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

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

$result = $audio->apply(new Afir(…), $other);

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
dryfloat10–10set dry gain
wetfloat10–10set wet gain
lengthfloat10–1set IR length
gtypeAfirGtypepeaknone, peak, dc, gn, ac, rmsset IR auto gain type
irnormfloat1-1–2set IR norm
irlinkbooltrue—set IR link
irgainfloat10–1set IR gain
irfmtAfirIrfmtinputmono, inputset IR format
maxirfloat300.1–60set max IR length
responseboolfalse—show IR frequency response
channelint00–1024set IR channel to display frequency response
sizestringhd720—set video size
ratestring25—set video rate
minpint81921–65536set min partition size
maxpint81928–65536set max partition size
nbirsint11–32set number of input IRs
irint00–31select IR
precisionAfirPrecisionautoauto, float, doubleset processing precision
irloadAfirIrloadinitinit, accessset IR loading type

Maps to FFmpeg’s afir 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.