Record Audio Files in the Command Line

From Lucca's Wiki
Revision as of 22:20, 25 August 2025 by Lucka (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The below command will use the default microphone you set on pulse, you can easily change it from pavucontrol.

ffmpeg -f pulse -i default -codec:a flac filename.flac

This records files in the lossless compressed flac format. You can make an bash function like this:

recordto () {
            ffmpeg -f pulse -i default -codec:a flac "${1}.flac"
}

and use the command like this:

recordto myaudiofile

and it will start recording to myaudiofile.flac