Tuesday, June 21, 2016

record sound on linux using ffmpeg command line

1- list all record devices
$ sudo arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3227 Analog [ALC3227 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


so we can see that there is only record device, card0, so if there are more that one you can choose which one is the source of the recording

2- start capturing using hw 0, and capture only 30 seconds and filename recorded01.wav
$ ffmpeg -f alsa -i hw:0 -t 30 recorded01.wav

3- so after 30 seconds we can use vlc or mplayer to listen to what we have captured.
$ mplayer recorded01.wav

No comments:

Post a Comment