Alex Balgavy

Just some stuff about me.

Here's my dotfiles repository.

Check out my blog.

My keys: PGP, SSH

My crypto wallets (BTC, XMR)

how to generate an audio tone in ffmpeg

Written by John Riselvato - original link

FFmpeg also has the ability to generate sounds or tones natively. With the right kind of scripting you could make chiptune like music straight from the terminal. In this example, generating a single 2000Hz sound for 10 seconds is enough for now:

 $ ffmpeg -f lavfi -i "sine=frequency=2000:duration=10" output.mp3

A new argument, lavfi, needs to be introduced here as this time there is no input media. Libavfilter,or lavfi as seen above, is an input virtual device that allows for filters, like sine, to virtually create data for future output.

sine
    Indicates the sine filter name. Sine generates signals made from sine waves

frequency, f
    Indicates the tone or frequency (with default 440Hz)

duration, d
    Indicates the duration of the generated frequency output