Record Audio Files in the Command Line

From Lucca's Wiki
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