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