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