]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/audio
audio(1): replace references to juke(7) and playlistfs(7) with zuke(1) (thanks unobe)
[plan9front.git] / sys / man / 1 / audio
1 .TH AUDIO 1
2 .SH NAME
3 mp3dec, mp3enc, oggdec, oggenc, flacdec, flacenc, sundec, wavdec, pcmconv, mixfs \- decode and encode audio files
4 .SH SYNOPSIS
5 .B audio/mp3dec
6 [
7 .B -s
8 .I seconds
9 ] [
10 .B -d
11 ]
12 .br
13 .B audio/oggdec
14 [
15 .B -s
16 .I seconds
17 ]
18 .br
19 .B audio/flacdec
20 [
21 .B -s
22 .I seconds
23 ]
24 .br
25 .B audio/wavdec
26 [
27 .B -s
28 .I seconds
29 ]
30 .br
31 .B audio/sundec
32 .PP
33 .B audio/oggenc
34 .br
35 .B audio/mp3enc
36 [
37 .B -hprv
38 ] [
39 .B -b
40 .I bitrate
41 ] [
42 .B -B
43 .I bitrate
44 ] [
45 .B -m
46 .I mode
47 ] [
48 .B -q
49 q ] [
50 .B -s
51 .I sfreq
52 ] [
53 .B -V
54 .I q
55 ] [
56 .I "long or silly options"
57 ]
58 .br
59 .B audio/flacenc
60 [
61 .B -b
62 .I bitspersample
63 ] [
64 .B -c
65 .I channels
66 ] [
67 .B -l
68 .I compresslevel
69 ] [
70 .B -s
71 .I sfreq
72 ] [
73 .B -P
74 .I padding
75 ] [
76 .B -T
77 .I field=value
78 ]
79 .PP
80 .B audio/pcmconv
81 [
82 .B -i
83 .I fmt
84 ] [
85 .B -o
86 .I fmt
87 ] [
88 .B -l
89 .I length
90 ]
91 .PP
92 .B audio/mixfs
93 [
94 .B -D
95 ] [
96 .B -s
97 .I srvname
98 ] [
99 .B -m
100 .I mtpt
101 ]
102 .PP
103 .SH DESCRIPTION
104 These programs decode and encode various audio formats from and to
105 16-bit stereo PCM (little endian). The decoders read the compressed
106 audio data from standard input and produce PCM on standard output at
107 a sampling frequency of 44.1KHz.
108 .PP
109 .I Mp3dec
110 decodes MPEG audio (layer 1, 2 and 3). The
111 .B -d
112 option enables debug output to standard error.
113 .I Oggdec,
114 .I flacdec,
115 .I sunwdec
116 and
117 .I wavdec
118 are like
119 .I mp3dec
120 but decode OGG Vorbis, FLAC lossless audio, Sun audio and RIFF wave.
121 .SS Decoding options
122 .TF "\fB-s seconds \fP"
123 .TP
124 .BI -s " seconds"
125 seek to a specific position in seconds before decoding.
126 .SS
127 .PP
128 The encoders read PCM on standard input and produce compressed audio
129 on standard output.
130 .PP
131 .I Flacenc,
132 .I oggenc
133 and
134 .I mp3enc
135 produce FLAC, OGG Vorbis and MP3 audio. For
136 .I mp3enc,
137 the MP3 file will use `constant bit-rate' (CBR) encoding by default, 
138 but that can be changed via
139 .B --abr
140 (average bitrate desired, ABR)
141 or
142 .BR -v
143 (variable bitrate, VBR).
144 .PP
145 .I Flacenc
146 and
147 .I oggenc
148 accept raw PCM in the same byte order as
149 .B /dev/audio
150 (little-endian),
151 while
152 .I mp3enc -r
153 expects big-endian.
154 .SS Encoding options
155 .TF "\fB-b \fP"
156 .TP
157 .B -b
158 set minimum allowed
159 .I bitrate
160 in Kb/s for VBR, default 32Kb/s.
161 For CBR,
162 set the exact bitrate in Kb/s, which defaults to 128Kb/s.
163 .TP
164 .B -B
165 set maximum allowed
166 .I bitrate
167 in Kb/s for VBR, default 256Kb/s.
168 .TP
169 .BI -h
170 same as
171 .LR "-q 2" .
172 .TP
173 .B -m
174 .I mode
175 may be
176 (s)tereo,
177 (j)oint,
178 (f)orce
179 or
180 (m)ono
181 (default j).
182 .B force
183 forces mid/side stereo on all frames.
184 .TP
185 .B -p
186 add CRC error protection (adds an additional 16 bits per frame to the stream).
187 This seems to break playback.
188 .TP
189 .B -q
190 sets output quality to
191 .I q
192 (see
193 .BR -V ).
194 .TP
195 .B -r
196 input is raw pcm
197 .TP
198 .B -s
199 set sampling frequency of input file (in KHz) to
200 .IR sfreq ,
201 default is 44.1.
202 .TP
203 .B -v
204 use variable bitrate (VBR) encoding
205 .TP
206 .B -V
207 set quality setting for VBR to
208 .IR q .
209 Default
210 .I q
211 is 4;
212 0 produces highest-quality and largest files, and
213 9 produces lowest-quality and smallest files.
214 .SS Long options
215 .TF "\fB--resample sfreq \fP"
216 .TP
217 .BI --abr " bitrate"
218 sets average
219 .I bitrate
220 desired in Kb/s, instead of setting quality,
221 and generates ABR encoding.
222 .TP
223 .BI --resample " sfreq"
224 set sampling frequency of output file (in KHz) to
225 .IR sfreq ,
226 default is input sfreq.
227 .TP
228 .BI --mp3input " input"
229 is an MP3 file
230 .
231 .SS Silly options
232 .TF --nohist
233 .TP
234 .B -f
235 same as
236 .LR "-q 7" .
237 Such a deal. 
238 .TP
239 .B -o
240 mark as non-original (i.e. do not set the original bit)
241 .TP
242 .B -c
243 mark as copyright
244 .TP
245 .B -k
246 disable sfb=21 cutoff
247 .TP
248 .BI -e " emp"
249 de-emphasis n/5/c
250 (default n)
251 .TP
252 .B -d
253 allow channels to have different blocktypes
254 .TP
255 .B -t
256 disable Xing VBR informational tag
257 .TP
258 .B -a
259 autoconvert from stereo to mono file for mono encoding
260 .TP
261 .B -x
262 force byte-swapping of input (see
263 .IR dd (1)
264 instead)
265 .TP
266 .B -S
267 don't print progress report, VBR histograms
268 .TP
269 .B --athonly
270 only use the ATH for masking
271 .TP
272 .B --nohist
273 disable VBR histogram display
274 .TP
275 .B --voice
276 experimental voice mode
277 .SS
278 .I Pcmconv
279 is a helper program used to convert various PCM sample formats. The
280 .B -i
281 and
282 .B -o
283 options specify the input and output format
284 .I fmt
285 of the conversion.
286 .I Fmt
287 is a concatenated string of the following parts:
288 .TP
289 .BI s #
290 sample format is little-endian signed integer where
291 .I #
292 specifies the number of bits
293 .TP
294 .BI u #
295 unsigned little-endian integer format
296 .TP
297 .BI S #
298 signed big-endian integer format
299 .TP
300 .BI U #
301 unsigned big-endian integer format
302 .TP
303 .BI f #
304 floating point format where
305 .I #
306 has to be 32 or 64 for single- or double-precision
307 .TP
308 .B a8
309 8-bit a-law format
310 .TP
311 .B µ8
312 8-bit µ-law format
313 .TP
314 .BI c #
315 specifies the number of channels
316 .TP
317 .BI r #
318 gives the samplerate in Hz
319 .PP
320 The program reads samples from standard
321 input converting the data and writes the result to standard output
322 until it reached end of file or, if
323 .B -l
324 was given, a number of
325 .I length
326 bytes have been consumed from input.
327 .PP
328 .I Mixfs
329 is a fileserver serving a single
330 .B audio
331 file which allows simultaneous playback of audio streams. When
332 run, it binds over
333 .B /dev/audio
334 and mixes the audio samples that are written to it.
335 A service name
336 .I srvname
337 can be given with the
338 .B -s
339 option which gets posted to
340 .BR /srv .
341 By default,
342 .I mixfs
343 mounts itself on
344 .B /mnt/mix
345 and then binds
346 .B /mnt/mix/audio
347 over
348 .BR /dev .
349 A alternative mountpoint 
350 .I mtpt
351 can be specified with the
352 .B -m
353 option.
354 The
355 .B -D
356 option causes
357 .B 9p
358 debug messages to be written to file-descriptor 2.
359 .SH EXAMPLE
360 Play back an
361 .L .mp3
362 .IP
363 .EX
364 audio/mp3dec <foo.mp3 >/dev/audio
365 .EE
366 .LP
367 Encode a
368 .L .wav
369 file as highest-quality MP3.
370 .IP
371 .EX
372 audio/mp3enc -q 0 -b 320 <foo.wav >foo.mp3
373 .EE
374 .LP
375 Create a fixed 128Kb/s MP3 file from a
376 .L .wav
377 file.
378 .IP
379 .EX
380 audio/mp3enc -h <foo.wav >foo.mp3
381 .EE
382 .LP
383 Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz
384 (you may not need
385 .IR dd ):
386 .IP
387 .EX
388 dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24
389 .EE
390 .SH SOURCE
391 .B /sys/src/cmd/audio
392 .SH "SEE ALSO"
393 .IR play (1),
394 .IR zuke (1)
395 .br
396 .B http://www.underbit.com/products/mad/
397 .br
398 .B http://xiph.org/doc/
399 .br
400 .B http://flac.sourceforge.net/documentation.html
401 .SH HISTORY
402 .I Pcmconv
403 first appeared in 9front (December, 2012).
404 .I Mixfs
405 first appeared in 9front (December, 2013).
406 .I Flacenc
407 first appeared in 9front (January, 2021).