1APLAY(1) General Commands Manual APLAY(1)
2
3
4
6 arecord, aplay - command-line sound recorder and player for ALSA sound‐
7 card driver
8
10 arecord [flags] [filename]
11 aplay [flags] [filename [filename]] ...
12
13
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
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
78 record/playback process will run until it is killed. Either
79 '-d' or '-s' option is available exclusively.
80
81 -s, --samples=#
82 Interrupt after tranmission of # PCM frames. A value of zero
83 means infinity. The default is zero, so if this options is
84 omitted then the record/playback process will run until it is
85 killed. Either '-d' or '-s' option is available exclusively.
86
87 -M, --mmap
88 Use memory-mapped (mmap) I/O mode for the audio stream. If this
89 option is not set, the read/write I/O mode will be used.
90
91 -N, --nonblock
92 Open the audio device in non-blocking mode. If the device is
93 busy the program will exit immediately. If this option is not
94 set the program will block until the audio device is available
95 again.
96
97 -F, --period-time=#
98 Distance between interrupts is # microseconds. If no period
99 time and no period size is given then a quarter of the buffer
100 time is set.
101
102 -B, --buffer-time=#
103 Buffer duration is # microseconds If no buffer time and no buf‐
104 fer size is given then the maximal allowed buffer time but not
105 more than 500ms is set.
106
107 --period-size=#
108 Distance between interrupts is # frames If no period size and no
109 period time is given then a quarter of the buffer size is set.
110
111 --buffer-size=#
112 Buffer duration is # frames If no buffer time and no buffer size
113 is given then the maximal allowed buffer time but not more than
114 500ms is set.
115
116 -A, --avail-min=#
117 Min available space for wakeup is # microseconds
118
119 -R, --start-delay=#
120 Delay for automatic PCM start is # microseconds (relative to
121 buffer size if <= 0)
122
123 -T, --stop-delay=#
124 Delay for automatic PCM stop is # microseconds from xrun
125
126 -v, --verbose
127 Show PCM structure and setup. This option is accumulative. The
128 VU meter is displayed when this is given twice or three times.
129
130 -V, --vumeter=TYPE
131 Specifies the VU-meter type, either stereo or mono. The stereo
132 VU-meter is available only for 2-channel stereo samples with
133 interleaved format.
134
135 -I, --separate-channels
136 One file for each channel. This option disables max-file-time
137 and use-strftime, and ignores SIGUSR1. The stereo VU meter is
138 not available with separate channels.
139
140 -P Playback. This is the default if the program is invoked by typ‐
141 ing aplay.
142
143 -C Record. This is the default if the program is invoked by typing
144 arecord.
145
146 -i, --interactive
147 Allow interactive operation via stdin. Currently only
148 pause/resume via space or enter key is implemented.
149
150 -m, --chmap=ch1,ch2,...
151 Give the channel map to override or follow. Pass channel posi‐
152 tion strings like FL, FR, etc.
153
154 If a device supports the override of the channel map, aplay
155 tries to pass the given channel map. If it doesn't support the
156 channel map override but still it provides the channel map
157 information, aplay tries to rearrange the channel order in the
158 buffer to match with the returned channel map from the device.
159
160 --disable-resample
161 Disable automatic rate resample.
162
163 --disable-channels
164 Disable automatic channel conversions.
165
166 --disable-format
167 Disable automatic format conversions.
168
169 --disable-softvol
170 Disable software volume control (softvol).
171
172 --test-position
173 Test ring buffer position.
174
175 --test-coef=<coef>
176 Test coefficient for ring buffer position; default is 8.
177 Expression for validation is: coef * (buffer_size / 2). Minimum
178 value is 1.
179
180 --test-nowait
181 Do not wait for the ring buffer ‐ eats the whole CPU.
182
183 --max-file-time
184 While recording, when the output file has been accumulating
185 sound for this long, close it and open a new output file.
186 Default is the maximum size supported by the file format: 2 GiB
187 for WAV files. This option has no effect if --separate-chan‐
188 nels is specified.
189
190 --process-id-file <file name>
191 aplay writes its process ID here, so other programs can send
192 signals to it.
193
194 --use-strftime
195 When recording, interpret %-codes in the file name parameter
196 using the strftime facility whenever the output file is opened.
197 The important strftime codes are: %Y is the year, %m month, %d
198 day of the month, %H hour, %M minute and %S second. In addi‐
199 tion, %v is the file number, starting at 1. When this option is
200 specified, intermediate directories for the output file are cre‐
201 ated automatically. This option has no effect if --sepa‐
202 rate-channels is specified.
203
204 --dump-hw-params
205 Dump hw_params of the device preconfigured status to stderr. The
206 dump lists capabilities of the selected device such as supported
207 formats, sampling rates, numbers of channels, period and buffer
208 bytes/sizes/times. For raw device hw:X this option basically
209 lists hardware capabilities of the soundcard.
210
211 --fatal-errors
212 Disables recovery attempts when errors (e.g. xrun) are encoun‐
213 tered; the aplay process instead aborts immediately.
214
215
217 When recording, SIGINT, SIGTERM and SIGABRT will close the output file
218 and exit. SIGUSR1 will close the output file, open a new one, and con‐
219 tinue recording. However, SIGUSR1 does not work with --separate-chan‐
220 nels.
221
222
224 aplay -c 1 -t raw -r 22050 -f mu_law foobar
225 will play the raw file "foobar" as a 22050-Hz, mono, 8-bit,
226 Mu-Law .au file.
227
228
229 arecord -d 10 -f cd -t wav -D copy foobar.wav
230 will record foobar.wav as a 10-second, CD-quality wave file,
231 using the PCM "copy" (which might be defined in the user's
232 .asoundrc file as:
233 pcm.copy {
234 type plug
235 slave {
236 pcm hw
237 }
238 route_policy copy
239 }
240
241
242 arecord -t wav --max-file-time 30 mon.wav
243 Record from the default audio source in monaural, 8,000 samples
244 per second, 8 bits per sample. Start a new file every 30 sec‐
245 onds. File names are mon-nn.wav, where nn increases from 01.
246 The file after mon-99.wav is mon-100.wav.
247
248
249 arecord -f cd -t wav --max-file-time 3600 --use-strftime %Y/%m/%d/lis‐
250 ten-%H-%M-%v.wav
251 Record in stereo from the default audio source. Create a new
252 file every hour. The files are placed in directories based on
253 their start dates and have names which include their start times
254 and file numbers.
255
256
258 alsamixer(1), amixer(1)
259
260
262 Note that .aiff files are not currently supported.
263
264
266 arecord and aplay are by Jaroslav Kysela <perex@perex.cz> This document
267 is by Paul Winkler <zarmzarm@erols.com>. Updated for Alsa 0.9 by James
268 Tappin <james@xena.uklinux.net>
269
270
271
272
273 1 January 2010 APLAY(1)