Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
.\" @(#)mpg123.1 0.01 21-Apr-1997 OF; from mpg123 archive
2
.TH mpg123 1 "21 Apr 1997"
3
.SH NAME
4
mpg123 \- play audio MPEG 1.0/2.0 file (layers 1, 2 and 3)
5
.SH SYNOPSIS
6
.B mpg123
7
[
8
.B \-tscvqy01m24
9
]
10
[
11
.BI \-b " size"
12
]
13
[
14
.BI \-k " num"
15
]
16
[
17
.BI \-n " num"
18
]
19
[
20
.BI \-f " factor"
21
]
22
[
23
.BI \-r " rate"
24
]
25
[
26
.BI \-g " gain"
27
]
28
[
29
.BI \-a " dev"
30
]
31
[
32
.BR "\-o s" " | " "\-o h" " | " "\-o l"
33
]
34
[
35
.BI \-d " n"
36
]
37
[
38
.BI \-h " n"
39
]
40
[
41
.BI \-p " proxy"
42
]
43
[
44
.BI \-@ " file"
45
]
46
.IR file " ... | " URL " ... | "
47
.B \-
48
.SH DESCRIPTION
49
.B mpg123
50
reads one or more
51
.IR file\^ s
52
(or standard input if ``\-'' is specified) or
53
.IR URL\^ s
54
and plays them on the audio device (default) or
55
outputs them to stdout.
56
.IR file\^ / URL
57
is assumed to be an MPEG-1/2 audio bit stream.
58
.SH OPTIONS
59
.B mpg123
60
options may be either the traditional POSIX one letter options,
61
or the GNU style long options.  POSIX style options start with a
62
single ``\-'', while GNU long options start with ``\-\^\-''.
63
.TP
64
.BR \-t ", " \-\^\-test
65
Test mode.  The audio stream is decoded, but no output occurs.
66
.TP
67
.BR \-s ", " \-\^\-stdout
68
The decoded audio samples are written to standard output,
69
instead of playing them through the audio device.  This
70
option must be used if your audio hardware is not supported
71
by
72
.BR mpg123 .
73
The output format is raw (headerless) linear PCM audio data,
74
16 bit, stereo, host byte order.
75
.TP
76
.BR \-c ", " \-\^\-check
77
Check for filter range violations, and report them for each frame
78
if any occur.
79
.TP
80
.BR \-v ", " \-\^\-verbose
81
Increase the verbosity level.  For example, displays the frame
82
numbers during decoding.
83
.TP
84
.BR \-q ", " \-\^\-quiet
85
Quiet.  Suppress diagnostic messages.
86
.TP
87
.BR \-y ", " \-\^\-resync
88
Try to resync and continue decoding if an error occurs in
89
the input file.  Also try to recover from certain broken
90
headers.  Useful if you have a broken MPEG file, on which
91
.B mpg123
92
normally gives up saying `Illegal header'.  Be careful:
93
Broken locations in MPEG files might cause sharp, loud pops or
94
clicks, which might damage your speakers if played too loud.
95
.TP
96
.BR \-0 ", " \-\^\-single0 "; " \-1 ", " \-\^\-single1
97
Decode only channel 0 (left) or channel 1 (right),
98
respectively.  These options are available for
99
stereo MPEG streams only.
100
.TP
101
.BR \-m ", " \-\^\-singlemix
102
Mix both channels.  This option is available for
103
stereo MPEG layer-3 streams only.  It takes less
104
CPU time than full stereo decoding.
105
.TP
106
.BR \-2 ", " \-\^\-2to1 "; " \-4 ", " \-\^\-4to1
107
Performs a downsampling of ratio 2:1 (22 kHz) or 4:1 (11 kHz)
108
on the output stream, respectively. Saves some CPU cycles, but
109
at least the 4:1 ratio sounds ugly.
110
.TP
111
\fB\-b \fIsize\fR, \fB\-\^\-buffer \fIsize
112
Use an audio output buffer of
113
.I size
114
Kbytes.  This is useful to bypass short periods of heavy
115
system activity, which would normally cause the audio output
116
to be interrupted.
117
You should specify a buffer size of at least 1024
118
(i.e. 1 Mb, which equals about 6 seconds of audio data) or more;
119
less than about 300 does not make much sense.  The default is 0,
120
which turns buffering off.
121
.TP
122
\fB\-k \fInum\fR, \fB\-\^\-skip \fInum
123
Skip first
124
.I num
125
frames.  By default the decoding starts at the first frame.
126
.TP
127
\fB\-n \fInum\fR, \fB\-\^\-frames \fInum
128
Decode only
129
.I num
130
frames.  By default the complete stream is decoded.
131
.TP
132
\fB\-f \fIfactor\fR, \fB\-\^\-scale \fIfactor
133
Change scale factor (default: 32768).
134
.TP
135
\fB\-r \fIrate\fR, \fB\-\^\-rate \fIrate
136
Set sample rate (default: automatic).  You don't want to
137
change this.
138
.TP
139
\fB\-g \fIgain\fR, \fB\-\^\-gain \fIgain
140
Set audio hardware output gain (default: don't change).
141
.TP
142
\fB\-a \fIdev\fR, \fB\-\^\-audiodevice \fIdev
143
Specify the audio device to use.  The default is
144
system-dependent (usually /dev/audio or /dev/dsp).
145
Use this option if you have multiple audio devices and
146
the default is not what you want.
147
.TP
148
.BR "\-o s" ", " \-\^\-speaker
149
Direct audio output to the speaker.
150
.TP
151
.BR "\-o h" ", " \-\^\-headphones
152
Direct audio output to the headphone connector.
153
.TP
154
.BR "\-o l" ", " \-\^\-lineout
155
Direct audio output to the line-out connector.
156
.TP
157
\fB\-d \fIn\fR, \fB\-\^\-doublespeed \fIn
158
Only play every
159
.IR n 'th
160
frame.  This will cause the MPEG stream
161
to be played
162
.I n
163
times faster, which can be used for special
164
effects.  Can also be combined with the
165
.B \-\^\-halfspeed
166
option to play 3 out of 4 frames etc.  Don't expect great
167
sound quality when using this option.
168
.TP
169
\fB\-h \fIn\fR, \fB\-\^\-halfspeed \fIn
170
Play each frame
171
.I n
172
times.  This will cause the MPEG stream
173
to be played at
174
.RI 1 / n 'th
175
speed (n times slower), which can be
176
used for special effects. Can also be combined with the
177
.B \-\^\-doublespeed
178
option to double every third frame or things like that.
179
Don't expect great sound quality when using this option.
180
.TP
181
\fB\-p \fIURL \fR| \fBnone\fR, \fB\-\^\-proxy \fIURL \fR| \fBnone
182
The specified
183
.I proxy
184
will be used for HTTP requests.  It
185
should be specified as full URL (``http://host.domain:port/''),
186
but the ``http://'' prefix, the port number and the trailing
187
slash are optional (the default port is 80).  Specifying
188
.B none
189
means not to use any proxy, and to retrieve files directly
190
from the respective servers.  See also the
191
``HTTP SUPPORT'' section.
192
.TP
193
\fB\-@ \fIfile\fR, \fB\-\^\-list \fIfile
194
Read filenames and/or URLs of MPEG audio streams from the specified
195
.I file
196
in addition to the ones specified on the command line (if any).
197
Note that
198
.I file
199
can be either an ordinary file, a dash ``\-'' to indicate that
200
a list of filenames/URLs is to be read from the standard input,
201
or an URL pointing to a an appropriate list file.  Note: only
202
one
203
.B \-@
204
option can be used (if more than one is specified, only the
205
last one will be recognized).
206
.SH OPERANDS
207
The following operands are supported:
208
.TP 8
209
.IR file (s)
210
The path name(s) of one or more input files.  They must be
211
valid MPEG-1/2 audio layer-1, -2 or -3 bit streams.
212
If a dash ``\-'' is specified, MPEG data will
213
be read from the standard input.  Furthermore, any name
214
starting with ``http://'' is recognized as
215
.I URL
216
(see next section).
217
.SH HTTP SUPPORT
218
In addition to reading MPEG audio streams from ordinary
219
files and from the standard input,
220
.B mpg123
221
supports retrieval of MPEG audio files via the HTTP protocol,
222
which is used in the World Wide Web (WWW).  Such files are
223
specified using a so-called URL (universal resource
224
location), which starts with ``http://''.  When a file with
225
that prefix is encountered,
226
.B mpg123
227
attempts to open an HTTP connection to the server in order to
228
retrieve that file to decode and play it.
229
.P
230
It is often useful to retrieve files through a WWW cache or
231
so-called proxy.  To accomplish this,
232
.B mpg123
233
examines the environment for variables named
234
.BR MP3_HTTP_PROXY ", " http_proxy " and " HTTP_PROXY ,
235
in this order.  The value of the first one that is set will
236
be used as proxy specification.  To override this, you can
237
use the
238
.B \-p
239
command line option (see the ``OPTIONS'' section).  Specifying
240
.B "\-p none"
241
will enforce contacting the server directly without using
242
any proxy, even if one of the above environment variables
243
is set.
244
.P
245
Note that, in order to play MPEG audio files from a WWW
246
server, it is necessary that the connection to that server
247
is fast enough.  For example, a 128 kbit/s MPEG file
248
requires the network connection to be at least 128 kbit/s
249
(16 kbyte/s) plus protocol overhead.  If you suffer from
250
short network outages, you should try the
251
.B \-b
252
option (buffer) to bypass such outages.  If your network
253
connection is generally not fast enough to retrieve MPEG
254
audio files in realtime, you can first download the files
255
to your local harddisk (e.g. using
256
.BR lynx (1))
257
and then play them from there.
258
.SH INTERRUPT
259
You can abort
260
.B mpg123
261
at any time by pressing Ctrl-C.  If you are playing multiple
262
files, this will stop the current file and begin playing the
263
next one.  If you want to abort playing immediately instead
264
of skipping to the next file, press Ctrl-C twice in short
265
succession (within about one second).
266
.P
267
Note that the result of pressing Ctrl-C might not be audible
268
immediately, due to audio data buffering in the audio device.
269
This delay is system dependent, but it is usually not more
270
than one or two seconds.
271
.SH "SEE ALSO"
272
.BR lynx (1),
273
.BR sox (1),
274
.BR intro (1)
275
.SH NOTES
276
MPEG audio decoding requires a good deal of CPU performance,
277
especially layer-3.  To decode it in realtime, you should
278
have at least a Pentium, Alpha, SuperSparc or equivalent
279
processor.  You can also use the
280
.B -singlemix
281
option to decode mono only, which reduces the CPU load
282
somewhat for layer-3 streams.  See also the
283
.BR \-2 " and " \-4
284
options.
285
.P
286
If everything else fails, use the
287
.B \-s
288
option to decode to standard output, direct it into a file
289
and then use an appropriate utility to play that file.
290
You might have to use a tool such as
291
.BR sox (1)
292
to convert the output to an audio format suitable for
293
your audio player.
294
.P
295
Also note that
296
.B mpg123
297
always generates 16 bit stereo data (if one of the
298
.BR \-single *
299
options is used, two identical stereo channels are
300
generated).  If your hardware requires some other
301
format, for example 8 bit mono, you also have
302
to use a converter such as
303
.BR sox (1).
304
.P
305
If your system is generally fast enough to decode in
306
realtime, but there are sometimes periods of heavy
307
system load (such as cronjobs, users logging in remotely,
308
starting of ``big'' programs etc.) causing the
309
audio output to be interrupted, then you should use
310
the
311
.B \-b
312
option to use a buffer of at least 1000 Kbytes.
313
.SH BUGS
314
.TP
315
Known bugs and limitations:
316
.br
317
MPEG-2, Layer 1 and 2 not tested. May not work. (Layer 3 should work.)
318
.br
319
Free format streams are not supported.
320
.br
321
Layer-1 support is not heavily tested.
322
.br
323
No CRC error checking is performed.
324
.br
325
There is currently no support for audio hardware on
326
DEC Digital Unix, Ultrix and IBM AIX, therefore the
327
.B \-s
328
option has to be used on those platforms.
329
.SH AUTHORS
330
.TP
331
Main author:
332
.br
333
Michael Hipp <Michael.Hipp@student.uni-tuebingen.de>
334
.TP
335
Uses code (or at least ideas) from:
336
.br
337
MPEG Software Simulation Group (Base package)
338
.br
339
Philipp Knirsch <phil@mpik-tueb.mpg.de> (DCT36/manual unroll)
340
.br
341
Tobias Bading <bading@cs.tu-berlin.de> (subband synthesis)
342
.br
343
Jeff Tsay <ctsay@pasteur.eecs.berkeley.edu> (DCT36)
344
.br
345
Thomas Woerner (SGI Audio)
346
.br
347
Damien Clermonte <clermond@esiee.fr> (HP-UX audio fixes)
348
.br
349
Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
350
.P
351
Internet references:
352
.br
353
http://www.sfs.nphil.uni-tuebingen.de/~hipp/mpg123.html
354
.br
355
http://www.heim3.tu-clausthal.de/~olli/mpg123/
356
.br
357
(includes information about the mpg123 mailing list)
358
.P
359
The latest version is also available from here:
360
.br
361
ftp.tu-clausthal.de:/pub/unix/audio/mpg123
362
.br
363
http://ftp.tu-clausthal.de/pub/unix/audio/mpg123