File: arecord.1

package info (click to toggle)
alsa-utils 1.0.28-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,280 kB
  • ctags: 1,585
  • sloc: ansic: 21,693; sh: 6,035; xml: 590; makefile: 374; sed: 16
file content (263 lines) | stat: -rw-r--r-- 8,914 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
.TH APLAY 1 "1 January 2010"
.SH NAME
arecord, aplay \- command\-line sound recorder and player for ALSA 
soundcard driver
.SH SYNOPSIS
\fBarecord\fP [\fIflags\fP] [filename]
.br
\fBaplay\fP [\fIflags\fP] [filename [filename]] ...

.SH DESCRIPTION
\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.

.SH OPTIONS
.TP
\fI\-h, \-\-help\fP
Help: show syntax.
.TP
\fI\-\-version\fP
Print current version.
.TP
\fI\-l, \-\-list\-devices\fP
List all soundcards and digital audio devices
.TP
\fI\-L, \-\-list\-pcms\fP
List all PCMs defined
.TP
\fI\-D, \-\-device=NAME\fP
Select PCM by name
.TP
\fI\-q \-\-quiet\fP
Quiet mode. Suppress messages (not sound :))
.TP
\fI\-t, \-\-file\-type TYPE\fP
File type (voc, wav, raw or au).
If this parameter is omitted the WAVE format is used.
.TP
\fI\-c, \-\-channels=#\fP
The number of channels.
The default is one channel.
Valid values are 1 through 32.
.TP
\fI\-f \-\-format=FORMAT\fP
Sample format
.br
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE
S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE
FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW
A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE
S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE
.br
Some of these may not be available on selected hardware
.br
The available format shortcuts are:
.nf
\-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]
.fi
If no format is given U8 is used.
.TP
\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.
.TP
\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.
.TP
\fI\-s, \-\-sleep\-min=#\fP
Min ticks to sleep. The default is not to sleep.
.TP
\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.
.TP
\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.
.TP
\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.
.TP
\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.
.TP
\fI\-\-period\-size=#\fP     
Distance between interrupts is # frames
If no period size and no period time is given then a quarter of the buffer size is set.
.TP
\fI\-\-buffer\-size=#\fP     
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.
.TP
\fI\-A, \-\-avail\-min=#\fP       
Min available space for wakeup is # microseconds
.TP
\fI\-R, \-\-start\-delay=#\fP     
Delay for automatic PCM start is # microseconds 
(relative to buffer size if <= 0)
.TP
\fI\-T, \-\-stop\-delay=#\fP      
Delay for automatic PCM stop is # microseconds from xrun
.TP
\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.
.TP
\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.
.TP
\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.
.TP
\fI\-P\fP
Playback.  This is the default if the program is invoked
by typing aplay.
.TP
\fI\-C\fP
Record.  This is the default if the program is invoked
by typing arecord.
.TP
\fI\-i, \-\-interactive\fP
Allow interactive operation via stdin.
Currently only pause/resume via space or enter key is implemented.
.TP
\fI-m, \-\-chmap=ch1,ch2,...\fP
Give the channel map to override or follow.  Pass channel position
strings like \fIFL\fP, \fIFR\fP, etc.

If a device supports the override of the channel map, \fBaplay\fP
tries to pass the given channel map.
If it doesn't support the channel map override but still it provides
the channel map information, \fBaplay\fP tries to rearrange the
channel order in the buffer to match with the returned channel map
from the device.
.TP
\fI\-\-disable\-resample\fP
Disable automatic rate resample.
.TP
\fI\-\-disable\-channels\fP
Disable automatic channel conversions.
.TP
\fI\-\-disable\-format\fP
Disable automatic format conversions.
.TP
\fI\-\-disable\-softvol\fP
Disable software volume control (softvol).
.TP
\fI\-\-test\-position\fP
Test ring buffer position.
.TP
\fI\-\-test\-coef=<coef>\fP
Test coefficient for ring buffer position; default is 8.
Expression for validation is: coef * (buffer_size / 2).
Minimum value is 1.
.TP
\fI\-\-test\-nowait\fP
Do not wait for the ring buffer \(hy eats the whole CPU.
.TP
\fI\-\-max\-file\-time\fP
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
specified.
.TP
\fI\-\-process\-id\-file <file name>\fP
aplay writes its process ID here, so other programs can
send signals to it.
.TP
\fI\-\-use\-strftime\fP
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.
.TP
\fI\-\-dump\-hw\-params\fP
Dump hw_params of the device preconfigured status to stderr. The dump
lists capabilities of the selected device such as supported formats,
sampling rates, numbers of channels, period and buffer bytes/sizes/times.
For raw device hw:X this option basically lists hardware capabilities of
the soundcard.
.TP
\fI\-\-fatal\-errors\fP
Disables recovery attempts when errors (e.g. xrun) are encountered; the
aplay process instead aborts immediately.

.SH SIGNALS
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
\-\-separate\-channels.

.SH EXAMPLES

.TP
\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. 

.TP
\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:
.nf
pcm.copy {
  type plug
  slave {
    pcm hw
  }
  route_policy copy
}
.fi

.TP
\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.

.TP
\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.

.SH SEE ALSO
\fB
alsamixer(1),
amixer(1)
\fP

.SH BUGS 
Note that .aiff files are not currently supported.

.SH AUTHOR
\fBarecord\fP and \fBaplay\fP are by Jaroslav Kysela <perex@perex.cz>
This document is by Paul Winkler <zarmzarm@erols.com>.
Updated for Alsa 0.9 by James Tappin <james@xena.uklinux.net>