Record Audio Files in the Command Line: Difference between revisions

From Lucca's Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 1: Line 1:
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
  ffmpeg -f pulse -i default -codec:a flac filename.flac



Latest revision as of 22:20, 25 August 2025

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