]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/audio
audio(1): µlawdec reference
[plan9front.git] / sys / man / 1 / audio
1 .TH AUDIO 1
2 .SH NAME
3 mp3dec, mp3enc, oggdec, oggenc, flacdec, µlawdec, 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/µlawdec
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 µlawdec
69 and
70 .I wavdec
71 are like
72 .I mp3dec
73 but decode OGG Vorbis, FLAC lossless audio, Sun µlaw audio and PCM 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
165 .I input
166 is an MP3 file
167 .
168 .SS Silly options
169 .TF --nohist
170 .TP
171 .BI -f
172 same as
173 .LR "-q 7" .
174 Such a deal. 
175 .TP
176 .BI -o
177 mark as non-original (i.e. do not set the original bit)
178 .TP
179 .BI -c
180 mark as copyright
181 .TP
182 .BI -k
183 disable sfb=21 cutoff
184 .TP
185 .BI -e " emp"
186 de-emphasis n/5/c
187 (default n)
188 .TP
189 .BI -d
190 allow channels to have different blocktypes
191 .TP
192 .BI -t
193 disable Xing VBR informational tag
194 .TP
195 .BI -a
196 autoconvert from stereo to mono file for mono encoding
197 .TP
198 .BI -x
199 force byte-swapping of input (see
200 .IR dd (1)
201 instead)
202 .TP
203 .BI -S
204 don't print progress report, VBR histograms
205 .TP
206 .BI --athonly
207 only use the ATH for masking
208 .TP
209 .BI --nohist
210 disable VBR histogram display
211 .TP
212 .BI --voice
213 experimental voice mode
214
215 .PP
216 .I Pcmconv
217 is a helper program used to convert various PCM sample formats. The
218 .B -i
219 and
220 .B -o
221 options specify the input and output format
222 .I fmt
223 of the conversion.
224 .I Fmt
225 is a concatinated string of the following parts:
226
227 .TP
228 .BI s #
229 sample format is little endian signed integer where
230 .I #
231 specifies the number of bits
232 .TP
233 .BI u #
234 unsigned little endian integer format
235 .TP
236 .BI f #
237 floating point format where
238 .I #
239 has to be 32 or 64 for single or double precisition
240 .TP
241 .BI c #
242 specifies the number of channels
243 .TP
244 .BI r #
245 gives the samplerate in Hz
246
247 .PP
248 The program reads samples from standard
249 input converting the data and writes the result to standard output
250 until it reached end of file or, if
251 .B -l
252 was given, a number of
253 .I length
254 bytes have been consumed from input.
255
256 .SH EXAMPLE
257 Play back an
258 .L .mp3
259 .IP
260 .EX
261 audio/mp3dec <foo.mp3 >/dev/audio
262 .EE
263 .LP
264 Encode a
265 .L .wav
266 file as highest-quality MP3.
267 .IP
268 .EX
269 audio/mp3enc -q 0 -b 320
270 .EE
271 .LP
272 Create a fixed 128Kb/s MP3 file from a
273 .L .wav
274 file.
275 .IP
276 .EX
277 audio/mp3enc -h <foo.wav >foo.mp3
278 .EE
279 .LP
280 Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz
281 (you may not need
282 .IR dd ):
283 .IP
284 .EX
285 dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24
286 .EE
287 .SH SOURCE
288 .B /sys/src/cmd/audio
289 .SH "SEE ALSO"
290 .IR play (1),
291 .IR juke (7),
292 .IR playlistfs (7)
293 .br
294 .B http://www.underbit.com/products/mad/
295 .br
296 .B http://xiph.org/doc/
297 .br
298 .B http://flac.sourceforge.net/documentation.html
299 .SH BUGS
300 It's another GNU behemoth, lightly tamed.