$linuxjunkies
>

arecord(1)

Record audio from the sound card to a file using ALSA.

UbuntuDebianFedoraArch

Synopsis

arecord [OPTION]... [FILE]

Description

arecord captures audio from your sound card's input device and saves it to a file or stdout. It's part of the ALSA (Advanced Linux Sound Architecture) utilities and supports various audio formats including WAV, AU, and RAW.

By default, arecord records in WAV format and will attempt to auto-detect the sample rate and number of channels. Use the format, rate, and channels options to explicitly specify recording parameters.

Common options

FlagWhat it does
-f FORMAT, --format=FORMATspecify sample format (S16_LE, S32_LE, U8, FLOAT_LE, etc.)
-c CHANNELS, --channels=CHANNELSnumber of channels (1 for mono, 2 for stereo, etc.)
-r RATE, --rate=RATEsample rate in Hz (44100, 48000, 96000, etc.)
-t TYPE, --file-type=TYPEfile type (wav, au, raw, voc, etc.)
-d DEVICE, --device=DEVICEspecify input device (default: default)
-D DEVICE, --list-deviceslist all available recording devices
-l, --list-pcmslist all available PCM devices and subdevices
-v, --verboseshow verbose output during recording
-q, --quietsuppress informational messages
-M, --nogrowdo not grow the file beyond 4GB (WAV limit)

Examples

Record audio in WAV format until Ctrl+C; auto-detects format from the card

arecord recording.wav

Record stereo audio at 44.1 kHz in 16-bit signed format to test.wav

arecord -f S16_LE -r 44100 -c 2 -t wav test.wav

Record from a specific sound card (hw:1,0) instead of the default device

arecord -d hw:1,0 recording.wav

Record mono audio at 48 kHz (common for video work)

arecord -c 1 -r 48000 mono_48k.wav

Record high-quality 96 kHz 32-bit audio with verbose output

arecord -v -f S32_LE -r 96000 hq_audio.wav

Show all available recording devices on your system

arecord --list-devices

Record raw audio for speech processing at 16 kHz (no WAV header)

arecord -t raw -f S16_LE -r 16000 speech.raw

Pipe recorded audio to ffmpeg for real-time MP3 encoding

arecord -r 44100 - | ffmpeg -i pipe: output.mp3

Related commands