LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

arecord

Record audio from ALSA sound devices

TLDR

Record in CD quality (finish with Ctrl+C)
$ arecord -vv -f cd [path/to/file.wav]
copy
Record with a fixed duration of 10 seconds
$ arecord -vv -f cd -d 10 [path/to/file.wav]
copy
Record and save as MP3 (via lame)
$ arecord -vv -f cd -t raw | lame -r - [path/to/file.mp3]
copy
List all sound cards and digital audio devices
$ arecord -l
copy
Allow interactive interface
$ arecord -i
copy
Test microphone with a 5 second sample
$ arecord -d 5 test-mic.wav && aplay test-mic.wav && rm test-mic.wav
copy

SYNOPSIS

arecord [-d duration] [-f format] [-r rate] [-c channels] [file]

DESCRIPTION

arecord is a command-line sound recorder for ALSA soundcard drivers. It captures audio from sound cards and saves it in various formats including WAV, AU, VOC, and raw audio. The tool supports configurable sample rates, bit depths, and channel counts. The shorthand format cd sets 16-bit signed little-endian stereo at 44100 Hz. Raw output can be piped to encoders like lame for MP3 conversion. It is the recording counterpart to aplay.

PARAMETERS

-d, --duration seconds

Stop recording after the specified number of seconds.
-f, --format format
Sample format (cd, S16LE, S16BE, U8, S32_LE, etc.).
-r, --rate rate
Sampling rate in Hz (2000-192000).
-c, --channels count
Number of channels (1 for mono, 2 for stereo).
-t, --file-type type
File type (wav, raw, au, voc).
-l, --list-devices
List all soundcards and digital audio devices.
-L, --list-pcms
List all PCMs defined.
-D, --device name
Select PCM device by name.
-M, --mmap
Use memory-mapped I/O mode for the audio stream.
-N, --nonblock
Open the audio device in non-blocking mode.
-F, --period-time microseconds
Distance between interrupts in microseconds.
-B, --buffer-time microseconds
Buffer duration in microseconds.
-V, --vumeter type
VU meter type (stereo or mono).
-i, --interactive
Allow interactive control via stdin.
-v, --verbose
Verbose mode; use -vv for more detail including VU meter.
-q, --quiet
Quiet mode; suppress messages.
--disable-resample
Disable automatic rate resample.
--disable-channels
Disable automatic channel conversions.
--disable-format
Disable automatic format conversions.

CAVEATS

Requires ALSA drivers to be installed and configured. The cd format is shorthand for 16-bit signed little-endian, 44100 Hz, stereo.

HISTORY

Part of ALSA (Advanced Linux Sound Architecture) utilities package, which replaced OSS as the standard Linux sound system.

SEE ALSO

aplay(1), alsamixer(1), amixer(1)

Copied to clipboard
Kai