aeval

doc

https://ffmpeg.org/ffmpeg-filters.html#aeval

see also

volume, aevalsrc, geq, (ffmpeg-utils)3. Expression Evaluation

This filter corresponds to geq for video. In other words, flexible processing using expressions can be performed. However, this is, after all, all you can do is process one input sample. This is of little use in audio processing. Processing of one input sample is, in short, an operation of amplitude, that is, volume operation. This is almost everything you can do with this filter. (In other words, you can realize tremolo by this filter but you can’t realize vibrato by this filter.) In addition, like geq, this filter is also very slow. Therefore, there is little significance in preferentially using this filter.

[me@host: ~]$ # Halve the input audio volume
[me@host: ~]$ ffplay some.wav -af "val(ch)/2:c=same"
[me@host: ~]$ # Invert phase of the second channel
[me@host: ~]$ ffplay some.wav -af "aeval=val(0)|-val(1)"
[me@host: ~]$ # decrease left channel volume, and increase right channel volume
[me@host: ~]$ ffplay some.wav -af "aeval='0.1 * val(0) | 1.1 * val(1)'"

Even though you can only do volume manipulation by this filter, this can be easier than using a dedicated “volume” filter:

[me@host: ~]$ # Applying "volume" filter to each channel separately
[me@host: ~]$ ffplay some.wav -af "
> channelsplit[Lo][Ro];
> [Lo]volume='abs(1 - mod(t, 2))':eval=frame[L];
> [Ro]volume='abs(1 - mod(t + 1, 2))':eval=frame[R];
> [L][R]join"
[me@host: ~]$ # almost same as above
[me@host: ~]$ ffplay some.wav -af "
> aeval='val(0) * abs(1 - mod(t, 2)) |
>        val(1) * abs(1 - mod(t + 1, 2))'"
see also

amultiply