Skip to content

Sine

Audio Single output Source

Generate sine wave audio signal.

FFmpeg filter: sine — the official reference.

Generate a stream. Sine 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 Sine());

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
frequencyfloat4400set the sine frequency
beep_factorfloat00set the beep frequency factor
sample_rateint441001set the sample rate
durationint00set the audio duration
samples_per_framestring1024set the number of samples per frame

FFmpeg also names these options (use the parameter shown above): ffrequency, bbeep_factor, rsample_rate, dduration.


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