blob: 8ccf5569a0b3a26bb0a73ff421d39090a158880f [file] [log] [blame]
.TH APLAY 1 "1 January 2010"
arecord, aplay \- command-line sound recorder and player for ALSA
soundcard driver
\fBarecord\fP [\fIflags\fP] [filename]
\fBaplay\fP [\fIflags\fP] [filename [filename]] ...
\fBarecord\fP is a command-line soundfile recorder for the ALSA soundcard
driver. It supports several file formats and multiple soundcards with
multiple devices. If recording with interleaved mode samples the file is
automatically split before the 2GB filesize.
\fBaplay\fP is much the same, only it plays instead of recording. For
supported soundfile formats, the sampling rate, bit depth, and so
forth can be automatically determined from the soundfile header.
If filename is not specified, the standard output or input is used. The \fBaplay\fP utility accepts multiple filenames.
\fI\-h, \-\-help\fP
Help: show syntax.
Print current version.
\fI\-l, \-\-list\-devices\fP
List all soundcards and digital audio devices
\fI\-L, \-\-list\-pcms\fP
List all PCMs defined
\fI\-D, \-\-device=NAME\fP
Select PCM by name
\fI\-q \-\-quiet\fP
Quiet mode. Suppress messages (not sound :))
\fI\-t, \-\-file\-type TYPE\fP
File type (voc, wav, raw or au).
If this parameter is omitted the WAVE format is used.
\fI\-c, \-\-channels=#\fP
The number of channels.
The default is one channel.
Valid values are 1 through 32.
\fI\-f \-\-format=FORMAT\fP
Sample format
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE
S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE
Some of these may not be available on selected hardware
The available format shortcuts are:
\-f cd (16 bit little endian, 44100, stereo) [\-f S16_LE \-c2 \-r44100]
\-f cdr (16 bit big endian, 44100, stereo) [\-f S16_BE \-c2 \-f44100]
\-f dat (16 bit little endian, 48000, stereo) [\-f S16_LE \-c2 \-r48000]
If no format is given U8 is used.
\fI\-r, \-\-rate=#<Hz>\fP
Sampling rate in Hertz. The default rate is 8000 Hertz.
If the value specified is less than 300, it is taken as the rate in kilohertz.
Valid values are 2000 through 192000 Hertz.
\fI\-d, \-\-duration=#\fP
Interrupt after # seconds.
A value of zero means infinity.
The default is zero, so if this option is omitted then the arecord process will run until it is killed.
\fI\-s, \-\-sleep\-min=#\fP
Min ticks to sleep. The default is not to sleep.
\fI\-M, \-\-mmap\fP
Use memory-mapped (mmap) I/O mode for the audio stream.
If this option is not set, the read/write I/O mode will be used.
\fI\-N, \-\-nonblock\fP
Open the audio device in non-blocking mode. If the device is busy the program will exit immediately.
If this option is not set the program will block until the audio device is available again.
\fI\-F, \-\-period\-time=#\fP
Distance between interrupts is # microseconds.
If no period time and no period size is given then a quarter of the buffer time is set.
\fI\-B, \-\-buffer\-time=#\fP
Buffer duration is # microseconds
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
Distance between interrupts is # frames
If no period size and no period time is given then a quarter of the buffer size is set.
Buffer duration is # frames
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
\fI\-A, \-\-avail\-min=#\fP
Min available space for wakeup is # microseconds
\fI\-R, \-\-start\-delay=#\fP
Delay for automatic PCM start is # microseconds
(relative to buffer size if <= 0)
\fI\-T, \-\-stop\-delay=#\fP
Delay for automatic PCM stop is # microseconds from xrun
\fI\-v, \-\-verbose\fP
Show PCM structure and setup.
This option is accumulative. The VU meter is displayed when this
is given twice or three times.
\fI\-V, \-\-vumeter=TYPE\fP
Specifies the VU-meter type, either \fIstereo\fP or \fImono\fP.
The stereo VU-meter is available only for 2-channel stereo samples
with interleaved format.
\fI\-I, \-\-separate\-channels\fP
One file for each channel. This option disables max\-file\-time
and use\-strftime, and ignores SIGUSR1. The stereo VU meter is
not available with separate channels.
Playback. This is the default if the program is invoked
by typing aplay.
Record. This is the default if the program is invoked
by typing arecord.
\fI\-i, \-\-interactive\fP
Allow interactive operation via stdin.
Currently only pause/resume via space or enter key is implemented.
Disable automatic rate resample.
Disable automatic channel conversions.
Disable automatic format conversions.
Disable software volume control (softvol).
Test ring buffer position.
Test coefficient for ring buffer position; default is 8.
Expression for validation is: coef * (buffer_size / 2).
Minimum value is 1.
Do not wait for the ring buffer--eats the whole CPU.
While recording, when the output file has been accumulating
sound for this long,
close it and open a new output file. Default is the maximum
size supported by the file format: 2 GiB for WAV files.
This option has no effect if \-\-separate\-channels is
\fI\-\-process\-id\-file <file name>\fP
aplay writes its process ID here, so other programs can
send signals to it.
When recording, interpret %-codes in the file name parameter using
the strftime facility whenever the output file is opened. The
important strftime codes are: %Y is the year, %m month, %d day of
the month, %H hour, %M minute and %S second. In addition, %v is
the file number, starting at 1. When this option is specified,
intermediate directories for the output file are created automatically.
This option has no effect if \-\-separate\-channels is specified.
When recording, SIGINT, SIGTERM and SIGABRT will close the output
file and exit. SIGUSR1 will close the output file, open a new one,
and continue recording. However, SIGUSR1 does not work with
\fBaplay \-c 1 \-t raw \-r 22050 \-f mu_law foobar\fR
will play the raw file "foobar" as a
22050-Hz, mono, 8-bit, Mu-Law .au file.
\fBarecord \-d 10 \-f cd \-t wav \-D copy foobar.wav\fP
will record foobar.wav as a 10-second, CD-quality wave file, using the
PCM "copy" (which might be defined in the user's .asoundrc file as:
pcm.copy {
type plug
slave {
pcm hw
route_policy copy
\fBarecord \-t wav \-max-file_time 30 mon.wav\fP
Record from the default audio source in monaural, 8,000 samples
per second, 8 bits per sample. Start a new file every
30 seconds. File names are mon-nn.wav, where nn increases
from 01. The file after mon-99.wav is mon-100.wav.
\fBarecord \-f cd \-t wav \-max-file-time 3600 --use-strftime %Y/%m/%d/listen-%H-%M-%v.wav\fP
Record in stereo from the default audio source. Create a new file
every hour. The files are placed in directories based on their start dates
and have names which include their start times and file numbers.
Note that .aiff files are not currently supported.
\fBarecord\fP and \fBaplay\fP are by Jaroslav Kysela <>
This document is by Paul Winkler <>.
Updated for Alsa 0.9 by James Tappin <>