1APLAY(1)                    General Commands Manual                   APLAY(1)
2
3
4

NAME

6       arecord, aplay - command-line sound recorder and player for ALSA sound‐
7       card driver
8

SYNOPSIS

10       arecord [flags] [filename]
11       aplay [flags] [filename [filename]] ...
12
13

DESCRIPTION

15       arecord is a command-line soundfile recorder  for  the  ALSA  soundcard
16       driver.  It  supports several file formats and multiple soundcards with
17       multiple devices. If recording with interleaved mode samples  the  file
18       is automatically split before the 2GB filesize.
19
20       aplay  is  much  the same, only it plays instead of recording. For sup‐
21       ported soundfile formats, the sampling rate, bit depth,  and  so  forth
22       can be automatically determined from the soundfile header.
23
24       If filename is not specified, the standard output or input is used. The
25       aplay utility accepts multiple filenames.
26
27

OPTIONS

29       -h, --help
30              Help: show syntax.
31
32       --version
33              Print current version.
34
35       -l, --list-devices
36              List all soundcards and digital audio devices
37
38       -L, --list-pcms
39              List all PCMs defined
40
41       -D, --device=NAME
42              Select PCM by name
43
44       -q --quiet
45              Quiet mode. Suppress messages (not sound :))
46
47       -t, --file-type TYPE
48              File type (voc, wav, raw or au).  If this parameter  is  omitted
49              the WAVE format is used.
50
51       -c, --channels=#
52              The number of channels.  The default is one channel.  Valid val‐
53              ues are 1 through 32.
54
55       -f --format=FORMAT
56              Sample format
57              Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE
58              S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE
59              FLOAT_BE FLOAT64_LE  FLOAT64_BE  IEC958_SUBFRAME_LE  IEC958_SUB‐
60              FRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE
61              U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE  S18_3BE
62              U18_3LE
63              Some of these may not be available on selected hardware
64              The available format shortcuts are:
65              -f cd (16 bit little endian, 44100, stereo) [-f S16_LE -c2 -r44100]
66              -f cdr (16 bit big endian, 44100, stereo) [-f S16_BE -c2 -f44100]
67              -f dat (16 bit little endian, 48000, stereo) [-f S16_LE -c2 -r48000]
68              If no format is given U8 is used.
69
70       -r, --rate=#<Hz>
71              Sampling  rate in Hertz. The default rate is 8000 Hertz.  If the
72              value specified is less than 300, it is taken  as  the  rate  in
73              kilohertz.  Valid values are 2000 through 192000 Hertz.
74
75       -d, --duration=#
76              Interrupt after # seconds.  A value of zero means infinity.  The
77              default is zero, so if this option is omitted then  the  arecord
78              process will run until it is killed.
79
80       -s, --sleep-min=#
81              Min ticks to sleep. The default is not to sleep.
82
83       -M, --mmap
84              Use memory-mapped (mmap) I/O mode for the audio stream.  If this
85              option is not set, the read/write I/O mode will be used.
86
87       -N, --nonblock
88              Open the audio device in non-blocking mode.  If  the  device  is
89              busy  the  program will exit immediately.  If this option is not
90              set the program will block until the audio device  is  available
91              again.
92
93       -F, --period-time=#
94              Distance  between  interrupts  is  # microseconds.  If no period
95              time and no period size is given then a quarter  of  the  buffer
96              time is set.
97
98       -B, --buffer-time=#
99              Buffer  duration is # microseconds If no buffer time and no buf‐
100              fer size is given then the maximal allowed buffer time  but  not
101              more than 500ms is set.
102
103       --period-size=#
104              Distance between interrupts is # frames If no period size and no
105              period time is given then a quarter of the buffer size is set.
106
107       --buffer-size=#
108              Buffer duration is # frames If no buffer time and no buffer size
109              is  given then the maximal allowed buffer time but not more than
110              500ms is set.
111
112       -A, --avail-min=#
113              Min available space for wakeup is # microseconds
114
115       -R, --start-delay=#
116              Delay for automatic PCM start is  #  microseconds  (relative  to
117              buffer size if <= 0)
118
119       -T, --stop-delay=#
120              Delay for automatic PCM stop is # microseconds from xrun
121
122       -v, --verbose
123              Show PCM structure and setup.  This option is accumulative.  The
124              VU meter is displayed when this is given twice or three times.
125
126       -V, --vumeter=TYPE
127              Specifies the VU-meter type, either stereo or mono.  The  stereo
128              VU-meter  is  available  only  for 2-channel stereo samples with
129              interleaved format.
130
131       -I, --separate-channels
132              One file for each channel.  This option  disables  max-file-time
133              and  use-strftime,  and ignores SIGUSR1.  The stereo VU meter is
134              not available with separate channels.
135
136       -P     Playback.  This is the default if the program is invoked by typ‐
137              ing aplay.
138
139       -C     Record.  This is the default if the program is invoked by typing
140              arecord.
141
142       -i, --interactive
143              Allow  interactive  operation   via   stdin.    Currently   only
144              pause/resume via space or enter key is implemented.
145
146       -m, --chmap=ch1,ch2,...
147              Give  the channel map to override or follow.  Pass channel posi‐
148              tion strings like FL, FR, etc.
149
150              If a device supports the override  of  the  channel  map,  aplay
151              tries  to pass the given channel map.  If it doesn't support the
152              channel map override but  still  it  provides  the  channel  map
153              information,  aplay  tries to rearrange the channel order in the
154              buffer to match with the returned channel map from the device.
155
156       --disable-resample
157              Disable automatic rate resample.
158
159       --disable-channels
160              Disable automatic channel conversions.
161
162       --disable-format
163              Disable automatic format conversions.
164
165       --disable-softvol
166              Disable software volume control (softvol).
167
168       --test-position
169              Test ring buffer position.
170
171       --test-coef=<coef>
172              Test  coefficient  for  ring  buffer  position;  default  is  8.
173              Expression for validation is: coef * (buffer_size / 2).  Minimum
174              value is 1.
175
176       --test-nowait
177              Do not wait for the ring buffer ‐ eats the whole CPU.
178
179       --max-file-time
180              While recording, when the  output  file  has  been  accumulating
181              sound  for  this  long,  close  it  and  open a new output file.
182              Default is the maximum size supported by the file format: 2  GiB
183              for  WAV  files.  This option has no effect if  --separate-chan‐
184              nels is specified.
185
186       --process-id-file <file name>
187              aplay writes its process ID here, so  other  programs  can  send
188              signals to it.
189
190       --use-strftime
191              When  recording,  interpret  %-codes  in the file name parameter
192              using the strftime facility whenever the output file is  opened.
193              The  important  strftime codes are: %Y is the year, %m month, %d
194              day of the month, %H hour, %M minute and %S  second.   In  addi‐
195              tion, %v is the file number, starting at 1.  When this option is
196              specified, intermediate directories for the output file are cre‐
197              ated  automatically.   This  option  has  no  effect  if --sepa‐
198              rate-channels is specified.
199
200       --dump-hw-params
201              Dump hw_params of the device preconfigured status to stderr. The
202              dump lists capabilities of the selected device such as supported
203              formats, sampling rates, numbers of channels, period and  buffer
204              bytes/sizes/times.   For  raw  device hw:X this option basically
205              lists hardware capabilities of the soundcard.
206
207       --fatal-errors
208              Disables recovery attempts when errors (e.g. xrun)  are  encoun‐
209              tered; the aplay process instead aborts immediately.
210
211

SIGNALS

213       When  recording, SIGINT, SIGTERM and SIGABRT will close the output file
214       and exit.  SIGUSR1 will close the output file, open a new one, and con‐
215       tinue  recording.  However, SIGUSR1 does not work with --separate-chan‐
216       nels.
217
218

EXAMPLES

220       aplay -c 1 -t raw -r 22050 -f mu_law foobar
221              will play the raw file "foobar"  as  a  22050-Hz,  mono,  8-bit,
222              Mu-Law .au file.
223
224
225       arecord -d 10 -f cd -t wav -D copy foobar.wav
226              will  record  foobar.wav  as  a 10-second, CD-quality wave file,
227              using the PCM "copy" (which  might  be  defined  in  the  user's
228              .asoundrc file as:
229              pcm.copy {
230                type plug
231                slave {
232                  pcm hw
233                }
234                route_policy copy
235              }
236
237
238       arecord -t wav --max-file-time 30 mon.wav
239              Record  from the default audio source in monaural, 8,000 samples
240              per second, 8 bits per sample.  Start a new file every  30  sec‐
241              onds.   File  names  are mon-nn.wav, where nn increases from 01.
242              The file after mon-99.wav is mon-100.wav.
243
244
245       arecord -f cd -t wav --max-file-time 3600 --use-strftime  %Y/%m/%d/lis‐
246       ten-%H-%M-%v.wav
247              Record  in  stereo  from the default audio source.  Create a new
248              file every hour.  The files are placed in directories  based  on
249              their start dates and have names which include their start times
250              and file numbers.
251
252

SEE ALSO

254        alsamixer(1), amixer(1)
255
256

BUGS

258       Note that .aiff files are not currently supported.
259
260

AUTHOR

262       arecord and aplay are by Jaroslav Kysela <perex@perex.cz> This document
263       is by Paul Winkler <zarmzarm@erols.com>.  Updated for Alsa 0.9 by James
264       Tappin <james@xena.uklinux.net>
265
266
267
268
269                                1 January 2010                        APLAY(1)
Impressum