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