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       --disable-resample
143              Disable automatic rate resample.
144
145       --disable-channels
146              Disable automatic channel conversions.
147
148       --disable-format
149              Disable automatic format conversions.
150
151       --disable-softvol
152              Disable software volume control (softvol).
153
154       --test-position
155              Test ring buffer position.
156
157       --test-coef=<coef>
158              Test  coefficient  for  ring  buffer  position;  default  is  8.
159              Expression for validation is: coef * (buffer_size / 2).  Minimum
160              value is 1.
161
162       --test-nowait
163              Do not wait for the ring buffer--eats the whole CPU.
164
165       --max-file-time
166              While recording, when the  output  file  has  been  accumulating
167              sound  for  this  long,  close  it  and  open a new output file.
168              Default is the maximum size supported by the file format: 2  GiB
169              for  WAV  files.  This option has no effect if  --separate-chan‐
170              nels is specified.
171
172       --process-id-file <file name>
173              aplay writes its process ID here, so  other  programs  can  send
174              signals to it.
175
176       --use-strftime
177              When  recording,  interpret  %-codes  in the file name parameter
178              using the strftime facility whenever the output file is  opened.
179              The  important  strftime codes are: %Y is the year, %m month, %d
180              day of the month, %H hour, %M minute and %S  second.   In  addi‐
181              tion, %v is the file number, starting at 1.  When this option is
182              specified, intermediate directories for the output file are cre‐
183              ated  automatically.   This  option  has  no  effect  if --sepa‐
184              rate-channels is specified.
185
186

SIGNALS

188       When recording, SIGINT, SIGTERM and SIGABRT will close the output  file
189       and exit.  SIGUSR1 will close the output file, open a new one, and con‐
190       tinue recording.  However, SIGUSR1 does not work with  --separate-chan‐
191       nels.
192
193

EXAMPLES

195       aplay -c 1 -t raw -r 22050 -f mu_law foobar
196              will  play the raw file "foobar" as a 22050-Hz, mono, 8-bit, Mu-
197              Law .au file.
198
199
200       arecord -d 10 -f cd -t wav -D copy foobar.wav
201              will record foobar.wav as a  10-second,  CD-quality  wave  file,
202              using  the  PCM  "copy"  (which  might  be defined in the user's
203              .asoundrc file as:
204              pcm.copy {
205                type plug
206                slave {
207                  pcm hw
208                }
209                route_policy copy
210              }
211
212
213       arecord -t wav -max-file_time 30 mon.wav
214              Record from the default audio source in monaural, 8,000  samples
215              per  second,  8 bits per sample.  Start a new file every 30 sec‐
216              onds.  File names are mon-nn.wav, where nn  increases  from  01.
217              The file after mon-99.wav is mon-100.wav.
218
219
220       arecord  -f  cd -t wav -max-file-time 3600 --use-strftime %Y/%m/%d/lis‐
221       ten-%H-%M-%v.wav
222              Record in stereo from the default audio source.   Create  a  new
223              file  every  hour.  The files are placed in directories based on
224              their start dates and have names which include their start times
225              and file numbers.
226
227

SEE ALSO

229        alsamixer(1), amixer(1)
230
231

BUGS

233       Note that .aiff files are not currently supported.
234
235

AUTHOR

237       arecord and aplay are by Jaroslav Kysela <perex@perex.cz> This document
238       is by Paul Winkler <zarmzarm@erols.com>.  Updated for Alsa 0.9 by James
239       Tappin <james@xena.uklinux.net>
240
241
242
243
244                                1 January 2010                        APLAY(1)
Impressum