arecord(1)
Record audio from the sound card to a file using ALSA.
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
| Flag | What it does |
|---|---|
-f FORMAT, --format=FORMAT | specify sample format (S16_LE, S32_LE, U8, FLOAT_LE, etc.) |
-c CHANNELS, --channels=CHANNELS | number of channels (1 for mono, 2 for stereo, etc.) |
-r RATE, --rate=RATE | sample rate in Hz (44100, 48000, 96000, etc.) |
-t TYPE, --file-type=TYPE | file type (wav, au, raw, voc, etc.) |
-d DEVICE, --device=DEVICE | specify input device (default: default) |
-D DEVICE, --list-devices | list all available recording devices |
-l, --list-pcms | list all available PCM devices and subdevices |
-v, --verbose | show verbose output during recording |
-q, --quiet | suppress informational messages |
-M, --nogrow | do 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.wavRecord 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.wavRecord from a specific sound card (hw:1,0) instead of the default device
arecord -d hw:1,0 recording.wavRecord mono audio at 48 kHz (common for video work)
arecord -c 1 -r 48000 mono_48k.wavRecord high-quality 96 kHz 32-bit audio with verbose output
arecord -v -f S32_LE -r 96000 hq_audio.wavShow all available recording devices on your system
arecord --list-devicesRecord raw audio for speech processing at 16 kHz (no WAV header)
arecord -t raw -f S16_LE -r 16000 speech.rawPipe recorded audio to ffmpeg for real-time MP3 encoding
arecord -r 44100 - | ffmpeg -i pipe: output.mp3