Skip to content

Afirsrc

Audio Single output Source

Generate a FIR coefficients audio stream.

FFmpeg filter: afirsrc — the official reference.

Generate a stream. Afirsrc is a source — it has no input, so you create a stream from it rather than applying it to one:

$audio = \FFmpeg\AudioStream::generate(new Afirsrc());

apply() and addFilter() do not apply to source filters (there is nothing to attach them to).

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
tapsint1025965535set number of taps
frequencystring0 1set frequency points
magnitudestring1 1set magnitude values
phasestring0 0set phase values
sample_rateint441001set sample rate
nb_samplesint10241set the number of samples per requested frame
win_funcAfirsrcWinFuncblackmanrect, bartlett, hanning, hamming, blackman, welch, flattop, bharris, …set window function

FFmpeg also names these options (use the parameter shown above): ttaps, ffrequency, mmagnitude, pphase, rsample_rate, nnb_samples, wwin_func.


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