Acrossfade
Audio Single output Transform
Cross fade two input audio streams.
FFmpeg filter:
acrossfade— 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 Acrossfade(…), [$other]);$result = $node->outputs()[0];Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:
$result = $audio->apply(new Acrossfade(…), $other);When to use it
Section titled “When to use it”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.
How to use it
Section titled “How to use it”TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).
Examples
Section titled “Examples”TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.
Gotchas
Section titled “Gotchas”TODO
See also
Section titled “See also”TODO
Parameters
Section titled “Parameters”| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
nb_samples | int | 44100 | 1–214748364 | set number of samples for cross fade duration |
duration | int | 0 | 0–60000000 | set cross fade duration |
overlap | bool | true | — | overlap 1st stream end with 2nd stream start |
curve1 | AcrossfadeCurve | tri | nofade, tri, qsin, esin, hsin, log, ipar, qua, … | set fade curve type for 1st stream |
curve2 | AcrossfadeCurve | tri | nofade, tri, qsin, esin, hsin, log, ipar, qua, … | set fade curve type for 2nd stream |
FFmpeg also names these options (use the parameter shown above): ns → nb_samples, d → duration, o → overlap, c1 → curve1, c2 → curve2.
Maps to FFmpeg’s acrossfade 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.