1audiorecord(1) User Commands audiorecord(1)
2
3
4
6 audiorecord - record an audio file
7
9 audiorecord [-af] [-v vol] [-c channels] [-s rate]
10 [-e encoding] [-t time] [-i info] [-d dev]
11 [-T au | aif[f] | wav] [file[.au|.aif[f]]|.wav]
12
13
15 The audiorecord utility copies audio data from the audio device to a
16 named audio file, or to the standard output if no filename is present.
17 If no output file is specified and standard output is a tty, the pro‐
18 gram exits with an error message.
19
20
21 By default, monaural audio data is recorded at 8 kHz and encoded in
22 -law format. If the audio device supports additional configurations,
23 the -c, -s, and -e options may be used to specify the data format. The
24 output file is prefixed by an audio file header that identifies the
25 format of the data encoded in the file.
26
27
28 Recording begins immediately and continues until a SIGINT signal (for
29 example, Control-c) is received. If the -t option is specified,
30 audiorecord stops when the specified quantity of data has been
31 recorded.
32
33
34 If the audio device is unavailable, that is, if another process cur‐
35 rently has read access, audiorecord prints an error message and exits
36 immediately.
37
39 The following options are supported:
40
41 -\? Help: Prints a command line usage message.
42
43
44 -a Append: Appends the data on the end of the
45 named audio file. The audio device must support
46 the audio data format of the existing file.
47
48
49 -c channels Channels: Specifies the number of audio chan‐
50 nels (1 or 2). The value may be specified as an
51 integer or as the string mono or stereo. The
52 default value is mono.
53
54
55 -d dev Device: The dev argument specifies an alternate
56 audio device from which input should be taken.
57 If the -d option is not specified, the AUDIODEV
58 environment variable is consulted (see below).
59 Otherwise, /dev/audio is used as the default
60 audio device.
61
62
63 -e encoding Encoding: Specifies the audio data encoding.
64 This value may be one of ulaw, alaw, or linear.
65 The default encoding is ulaw.
66
67
68 -f Force: When the -a flag is specified, the sam‐
69 ple rate of the audio device must match the
70 sample rate at which the original file was
71 recorded. If the -f flag is also specified,
72 sample rate differences are ignored, with a
73 warning message printed on the standard error.
74
75
76 -i info Information: The `information' field of the
77 output file header is set to the string speci‐
78 fied by the info argument. This option cannot
79 be specified in conjunction with the -a argu‐
80 ment.
81
82
83 -s rate Sample Rate: Specifies the sample rate, in sam‐
84 ples per second. If a number is followed by the
85 letter k, it is multiplied by 1000 (for exam‐
86 ple, 44.1k = 44100). The default sample rate is
87 8 kHz.
88
89
90 -t time Time: The time argument specifies the maximum
91 length of time to record. Time can be specified
92 as a floating-point value, indicating the num‐
93 ber of seconds, or in the form: hh:mm:ss.dd,
94 where the hour and minute specifications are
95 optional.
96
97
98 -T au | aif[f] | wav Specifies the audio file type to create. If the
99 -a option is used, the file type must match the
100 file to which it is being appended. Regardless
101 of the file suffix, the type is set as speci‐
102 fied in this option. If this option is not
103 specified, the file suffix determines the type.
104
105
106 -v vol Volume: The recording gain is set to the speci‐
107 fied value before recording begins, and is
108 reset to its previous level when audiorecord
109 exits. The vol argument is an integer value
110 between 0 and 100, inclusive. If this argument
111 is not specified, the input volume remains at
112 the level most recently set by any process.
113
114
116 file[.au|.aif[f]]|.wav
117
118 File Specification: The named audio file is rewritten, or appended.
119 If no filename is present, and standard output is not a tty, or if
120 the special filename "−" is specified, output is directed to the
121 the standard output.
122
123 If the -T option is not specified, the file suffix determines the
124 type of file. If the suffix is not recognized, the default is .au.
125 If the -T option is specified, that file type is used regardless of
126 the file suffix.
127
128
130 See largefile(5) for the description of the behavior of audiorecord
131 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
132
134 AUDIODEV The full path name of the audio device to record from, if
135 no -d argument is supplied. If the AUDIODEV variable is not
136 set, /dev/audio is used.
137
138
140 See attributes(5) for descriptions of the following attributes:
141
142
143
144
145 ┌─────────────────────────────┬─────────────────────────────┐
146 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
147 ├─────────────────────────────┼─────────────────────────────┤
148 │Architecture │SPARC, x86 │
149 ├─────────────────────────────┼─────────────────────────────┤
150 │Availability │SUNWauda │
151 ├─────────────────────────────┼─────────────────────────────┤
152 │Interface Stability │Committed │
153 └─────────────────────────────┴─────────────────────────────┘
154
156 audioconvert(1), audioplay(1), mixerctl(1), attributes(5), large‐
157 file(5), audio(7I)
158
159
160
161SunOS 5.11 5 May 2009 audiorecord(1)