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