1 AUDIOCONVERT(1) User Commands AUDIOCONVERT(1)
2
3
4
5 NAME
6 audioconvert - convert audio file formats
7
8 SYNOPSIS
9 audioconvert [-pF] [-f outfmt] [-o outfile]
10 [ [-i infmt] [file]...] ...
11
12
13 DESCRIPTION
14 audioconvert converts audio data between a set of supported audio
15 encodings and file formats. It can be used to compress and decompress
16 audio data, to add audio file headers to raw audio data files, and to
17 convert between standard data encodings, such as -law and linear PCM.
18
19
20 If no filenames are present, audioconvert reads the data from the
21 standard input stream and writes an audio file to the standard output.
22 Otherwise, input files are processed in order, concatenated, and
23 written to the output file.
24
25
26 Input files are expected to contain audio file headers that identify
27 the audio data format. If the audio data does not contain a
28 recognizable header, the format must be specified with the -i option,
29 using the rate, encoding, and channels keywords to identify the input
30 data format.
31
32
33 The output file format is derived by updating the format of the first
34 input file with the format options in the -f specification. If -p is
35 not specified, all subsequent input files are converted to this
36 resulting format and concatenated together. The output file will
37 contain an audio file header, unless format=raw is specified in the
123 The audio sampling rate is specified in samples per second.
124 If a number is followed by the letter k, it is multiplied
125 by 1000 (for example, 44.1k = 44100). Standard of the
126 commonly used sample rates are: 8k, 16k, 32k, 44.1k, and
127 48k.
128
129
130 channels
131 The number of interleaved channels is specified as an
132 integer. The words mono and stereo may also be used to
133 specify one and two channel data, respectively.
134
135
136 encoding
137 This option specifies the digital audio data
138 representation. Encodings determine precision implicitly
139 (ulaw implies 8-bit precision) or explicitly as part of the
140 name (for example, linear16). Valid encoding values are:
141
142 ulaw
143 CCITT G.711 -law encoding. This is an 8-bit
144 format primarily used for telephone quality
145 speech.
146
147
148 alaw
149 CCITT G.711 A-law encoding. This is an 8-bit
150 format primarily used for telephone quality
151 speech in Europe.
152
153
154 linear8,
155 linear16,
156 linear32
157 Linear Pulse Code Modulation (PCM) encoding.
158 The name identifies the number of bits of
159 precision. linear16 is typically used for high
160 quality audio data.
161
162
163 pcm
164 Same as linear16.
165
166
167 g721
168 CCITT G.721 compression format. This encoding
169 uses Adaptive Delta Pulse Code Modulation
170 (ADPCM) with 4-bit precision. It is primarily
171 used for compressing -law voice data
172 (achieving a 2:1 compression ratio).
173
174
175 g723
176 CCITT G.723 compression format. This encoding
177 uses Adaptive Delta Pulse Code Modulation
178 (ADPCM) with 3-bit precision. It is primarily
179 used for compressing -law voice data
180 (achieving an 8:3 compression ratio). The
181 audio quality is similar to G.721, but may
182 result in lower quality when used for non-
183 speech data.
184
185 The following encoding values are also accepted as
186 shorthand to set the sample rate, channels, and encoding:
187
188 voice
189 Equivalent to encoding=ulaw,rate=8k,channels=mono.
190
191
192 cd
193 Equivalent to
194 encoding=linear16,rate=44.1k,channels=stereo.
195
196
197 dat
198 Equivalent to
199 encoding=linear16,rate=48k,channels=stereo.
206
207 sun
208 Sun compatible file format (the default).
209
210
211 raw
212 Use this format when reading or writing raw audio
213 data (with no audio header), or in conjunction with
214 an offset to import a foreign audio file format.
215
216
217
218 offset
219 (-i only) Specifies a byte offset to locate the start of
220 the audio data. This option may be used to import audio
221 data that contains an unrecognized file header.
222
223
224 USAGE
225 See largefile(5) for the description of the behavior of audioconvert
226 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
227
228 EXAMPLES
229 Example 1 Recording and compressing voice data before storing it
230
231
232 Record voice data and compress it before storing it to a file:
233
234
235 example% audiorecord | audioconvert -f g721 > mydata.au
236
237
238
239 Example 2 Concatenating two audio files
240
241
242 Concatenate two Sun format audio files, regardless of their data
243 format, and output an 8-bit ulaw, 16 kHz, mono file:
244
245
246 example% audioconvert -f ulaw,rate=16k,mono -o outfile.au infile1 infile2
247
248
249
250 Example 3 Converting a directory to Sun format
251
252
253 Convert a directory containing raw voice data files, in place, to Sun
254 format (adds a file header to each file):
255
256
257 example% audioconvert -p -i voice -f sun *.au
258
259
260
261 ATTRIBUTES
262 See attributes(5) for descriptions of the following attributes:
263
264
265
266
267 +--------------------+-----------------+
268 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
269 +--------------------+-----------------+
270 |Architecture | SPARC, x86 |
271 +--------------------+-----------------+
272 |Interface Stability | Evolving |
273 +--------------------+-----------------+
274
275 SEE ALSO
276 audioplay(1), audiorecord(1), file(1), attributes(5), largefile(5)
277
278 NOTES
279 The algorithm used for converting multi-channel data to mono is
280 implemented by simply summing the channels together. If the input data
281 is perfectly in phase (as would be the case if a mono file is converted
282 to stereo and back to mono), the resulting data may contain some
283 distortion.
284
285
286
287 February 16, 2001 AUDIOCONVERT(1)
|
1 AUDIOCONVERT(1) User Commands AUDIOCONVERT(1)
2
3
4
5 NAME
6 audioconvert - convert audio file formats
7
8 SYNOPSIS
9 audioconvert [-pF] [-f outfmt] [-o outfile]
10 [ [-i infmt] [file]...] ...
11
12
13 DESCRIPTION
14 audioconvert converts audio data between a set of supported audio
15 encodings and file formats. It can be used to compress and decompress
16 audio data, to add audio file headers to raw audio data files, and to
17 convert between standard data encodings, such as u-law and linear PCM.
18
19
20 If no filenames are present, audioconvert reads the data from the
21 standard input stream and writes an audio file to the standard output.
22 Otherwise, input files are processed in order, concatenated, and
23 written to the output file.
24
25
26 Input files are expected to contain audio file headers that identify
27 the audio data format. If the audio data does not contain a
28 recognizable header, the format must be specified with the -i option,
29 using the rate, encoding, and channels keywords to identify the input
30 data format.
31
32
33 The output file format is derived by updating the format of the first
34 input file with the format options in the -f specification. If -p is
35 not specified, all subsequent input files are converted to this
36 resulting format and concatenated together. The output file will
37 contain an audio file header, unless format=raw is specified in the
123 The audio sampling rate is specified in samples per second.
124 If a number is followed by the letter k, it is multiplied
125 by 1000 (for example, 44.1k = 44100). Standard of the
126 commonly used sample rates are: 8k, 16k, 32k, 44.1k, and
127 48k.
128
129
130 channels
131 The number of interleaved channels is specified as an
132 integer. The words mono and stereo may also be used to
133 specify one and two channel data, respectively.
134
135
136 encoding
137 This option specifies the digital audio data
138 representation. Encodings determine precision implicitly
139 (ulaw implies 8-bit precision) or explicitly as part of the
140 name (for example, linear16). Valid encoding values are:
141
142 ulaw
143 CCITT G.711 u-law encoding. This is an 8-bit
144 format primarily used for telephone quality
145 speech.
146
147
148 alaw
149 CCITT G.711 A-law encoding. This is an 8-bit
150 format primarily used for telephone quality
151 speech in Europe.
152
153
154 linear8,
155 linear16,
156 linear32
157 Linear Pulse Code Modulation (PCM) encoding.
158 The name identifies the number of bits of
159 precision. linear16 is typically used for high
160 quality audio data.
161
162
163 pcm
164 Same as linear16.
165
166
167 g721
168 CCITT G.721 compression format. This encoding
169 uses Adaptive Delta Pulse Code Modulation
170 (ADPCM) with 4-bit precision. It is primarily
171 used for compressing u-law voice data
172 (achieving a 2:1 compression ratio).
173
174
175 g723
176 CCITT G.723 compression format. This encoding
177 uses Adaptive Delta Pulse Code Modulation
178 (ADPCM) with 3-bit precision. It is primarily
179 used for compressing u-law voice data
180 (achieving an 8:3 compression ratio). The
181 audio quality is similar to G.721, but may
182 result in lower quality when used for non-
183 speech data.
184
185 The following encoding values are also accepted as
186 shorthand to set the sample rate, channels, and encoding:
187
188 voice
189 Equivalent to encoding=ulaw,rate=8k,channels=mono.
190
191
192 cd
193 Equivalent to
194 encoding=linear16,rate=44.1k,channels=stereo.
195
196
197 dat
198 Equivalent to
199 encoding=linear16,rate=48k,channels=stereo.
206
207 sun
208 Sun compatible file format (the default).
209
210
211 raw
212 Use this format when reading or writing raw audio
213 data (with no audio header), or in conjunction with
214 an offset to import a foreign audio file format.
215
216
217
218 offset
219 (-i only) Specifies a byte offset to locate the start of
220 the audio data. This option may be used to import audio
221 data that contains an unrecognized file header.
222
223
224 USAGE
225 See largefile(5) for the description of the behavior of audioconvert
226 when encountering files greater than or equal to 2 Gbyte (2^31 bytes).
227
228 EXAMPLES
229 Example 1 Recording and compressing voice data before storing it
230
231
232 Record voice data and compress it before storing it to a file:
233
234
235 example% audiorecord | audioconvert -f g721 > mydata.au
236
237
238
239 Example 2 Concatenating two audio files
240
241
242 Concatenate two Sun format audio files, regardless of their data
243 format, and output an 8-bit ulaw, 16 kHz, mono file:
244
245
246 example% audioconvert -f ulaw,rate=16k,mono -o outfile.au infile1 infile2
247
248
249
250 Example 3 Converting a directory to Sun format
251
252
253 Convert a directory containing raw voice data files, in place, to Sun
254 format (adds a file header to each file):
255
256
257 example% audioconvert -p -i voice -f sun *.au
258
259
260
261 SEE ALSO
262 audioplay(1), audiorecord(1), file(1), largefile(5)
263
264 NOTES
265 The algorithm used for converting multi-channel data to mono is
266 implemented by simply summing the channels together. If the input data
267 is perfectly in phase (as would be the case if a mono file is converted
268 to stereo and back to mono), the resulting data may contain some
269 distortion.
270
271
272
273 February 8, 2020 AUDIOCONVERT(1)
|