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