arecord Command Examples in Linux

arecord is a command line utility for recording audio on a Linux system. It is part of the alsa-utils package, which provides command line utilities for the Advanced Linux Sound Architecture (ALSA) on Linux.

To use arecord, you need to specify the name of an audio device to record from and a filename to save the recorded audio to. For example, the following command will record audio from the default audio input device and save it to a file called recording.wav:

# arecord -f cd -t wav recording.wav

arecord supports a variety of options to control the recording process, such as specifying the audio format and sample rate, setting the recording duration, and enabling or disabling audio effects such as noise reduction. You can view a full list of options by running man arecord in the terminal.

It’s worth noting that arecord is just one of several tools available for recording audio on a Linux system. Other options include rec from the sox package and parec from the pulseaudio-utils package.

arecord Command Examples

1. Record a snippet in “CD” quality (finish with Ctrl-C when done):

# arecord -vv --format=cd {{path/to/file.wav}}

2. Record a snippet in “CD” quality, with a fixed duration of 10 seconds:

# arecord -vv --format=cd --duration={{10}} {{path/to/file.wav}}

3. Record a snippet and save it as an MP3 (finish with Ctrl-C when done):

# arecord -vv --format=cd --file-type raw | lame -r - {{path/to/file.mp3}}

4. List all sound cards and digital audio devices:

# arecord --list-devices

5. Allow interactive interface (e.g. use space-bar or enter to play or pause):

# arecord --interactive
Related Post