Subversion Repositories shark

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

.\" @(#)mpg123.1 0.01 21-Apr-1997 OF; from mpg123 archive
.TH mpg123 1 "21 Apr 1997"
.SH NAME
mpg123 \- play audio MPEG 1.0/2.0 file (layers 1, 2 and 3)
.SH SYNOPSIS
.B mpg123
[
.B \-tscvqy01m24
]
[
.BI \-b " size"
]
[
.BI \-k " num"
]
[
.BI \-n " num"
]
[
.BI \-f " factor"
]
[
.BI \-r " rate"
]
[
.BI \-g " gain"
]
[
.BI \-a " dev"
]
[
.BR "\-o s" " | " "\-o h" " | " "\-o l"
]
[
.BI \-d " n"
]
[
.BI \-h " n"
]
[
.BI \-p " proxy"
]
[
.BI \-@ " file"
]
.IR file " ... | " URL " ... | "
.B \-
.SH DESCRIPTION
.B mpg123
reads one or more
.IR file\^ s
(or standard input if ``\-'' is specified) or
.IR URL\^ s
and plays them on the audio device (default) or
outputs them to stdout.
.IR file\^ / URL
is assumed to be an MPEG-1/2 audio bit stream.
.SH OPTIONS
.B mpg123
options may be either the traditional POSIX one letter options,
or the GNU style long options.  POSIX style options start with a
single ``\-'', while GNU long options start with ``\-\^\-''.
.TP
.BR \-t ", " \-\^\-test
Test mode.  The audio stream is decoded, but no output occurs.
.TP
.BR \-s ", " \-\^\-stdout
The decoded audio samples are written to standard output,
instead of playing them through the audio device.  This
option must be used if your audio hardware is not supported
by
.BR mpg123 .
The output format is raw (headerless) linear PCM audio data,
16 bit, stereo, host byte order.
.TP
.BR \-c ", " \-\^\-check
Check for filter range violations, and report them for each frame
if any occur.
.TP
.BR \-v ", " \-\^\-verbose
Increase the verbosity level.  For example, displays the frame
numbers during decoding.
.TP
.BR \-q ", " \-\^\-quiet
Quiet.  Suppress diagnostic messages.
.TP
.BR \-y ", " \-\^\-resync
Try to resync and continue decoding if an error occurs in
the input file.  Also try to recover from certain broken
headers.  Useful if you have a broken MPEG file, on which
.B mpg123
normally gives up saying `Illegal header'.  Be careful:
Broken locations in MPEG files might cause sharp, loud pops or
clicks, which might damage your speakers if played too loud.
.TP
.BR \-0 ", " \-\^\-single0 "; " \-1 ", " \-\^\-single1
Decode only channel 0 (left) or channel 1 (right),
respectively.  These options are available for
stereo MPEG streams only.
.TP
.BR \-m ", " \-\^\-singlemix
Mix both channels.  This option is available for
stereo MPEG layer-3 streams only.  It takes less
CPU time than full stereo decoding.
.TP
.BR \-2 ", " \-\^\-2to1 "; " \-4 ", " \-\^\-4to1
Performs a downsampling of ratio 2:1 (22 kHz) or 4:1 (11 kHz) 
on the output stream, respectively. Saves some CPU cycles, but 
at least the 4:1 ratio sounds ugly.
.TP
\fB\-b \fIsize\fR, \fB\-\^\-buffer \fIsize
Use an audio output buffer of
.I size
Kbytes.  This is useful to bypass short periods of heavy
system activity, which would normally cause the audio output 
to be interrupted.  
You should specify a buffer size of at least 1024 
(i.e. 1 Mb, which equals about 6 seconds of audio data) or more; 
less than about 300 does not make much sense.  The default is 0, 
which turns buffering off.
.TP
\fB\-k \fInum\fR, \fB\-\^\-skip \fInum
Skip first
.I num
frames.  By default the decoding starts at the first frame.
.TP
\fB\-n \fInum\fR, \fB\-\^\-frames \fInum
Decode only
.I num
frames.  By default the complete stream is decoded.
.TP
\fB\-f \fIfactor\fR, \fB\-\^\-scale \fIfactor
Change scale factor (default: 32768).
.TP
\fB\-r \fIrate\fR, \fB\-\^\-rate \fIrate
Set sample rate (default: automatic).  You don't want to
change this.
.TP
\fB\-g \fIgain\fR, \fB\-\^\-gain \fIgain
Set audio hardware output gain (default: don't change).
.TP
\fB\-a \fIdev\fR, \fB\-\^\-audiodevice \fIdev
Specify the audio device to use.  The default is
system-dependent (usually /dev/audio or /dev/dsp).
Use this option if you have multiple audio devices and
the default is not what you want.
.TP
.BR "\-o s" ", " \-\^\-speaker
Direct audio output to the speaker.
.TP
.BR "\-o h" ", " \-\^\-headphones
Direct audio output to the headphone connector.
.TP
.BR "\-o l" ", " \-\^\-lineout
Direct audio output to the line-out connector.
.TP
\fB\-d \fIn\fR, \fB\-\^\-doublespeed \fIn
Only play every
.IR n 'th
frame.  This will cause the MPEG stream
to be played
.I n
times faster, which can be used for special
effects.  Can also be combined with the
.B \-\^\-halfspeed
option to play 3 out of 4 frames etc.  Don't expect great
sound quality when using this option.
.TP
\fB\-h \fIn\fR, \fB\-\^\-halfspeed \fIn
Play each frame
.I n
times.  This will cause the MPEG stream
to be played at
.RI 1 / n 'th
speed (n times slower), which can be
used for special effects. Can also be combined with the
.B \-\^\-doublespeed
option to double every third frame or things like that.
Don't expect great sound quality when using this option.
.TP
\fB\-p \fIURL \fR| \fBnone\fR, \fB\-\^\-proxy \fIURL \fR| \fBnone
The specified
.I proxy
will be used for HTTP requests.  It
should be specified as full URL (``http://host.domain:port/''),
but the ``http://'' prefix, the port number and the trailing
slash are optional (the default port is 80).  Specifying
.B none
means not to use any proxy, and to retrieve files directly
from the respective servers.  See also the
``HTTP SUPPORT'' section.
.TP
\fB\-@ \fIfile\fR, \fB\-\^\-list \fIfile
Read filenames and/or URLs of MPEG audio streams from the specified
.I file
in addition to the ones specified on the command line (if any).
Note that
.I file
can be either an ordinary file, a dash ``\-'' to indicate that
a list of filenames/URLs is to be read from the standard input,
or an URL pointing to a an appropriate list file.  Note: only
one
.B \-@
option can be used (if more than one is specified, only the
last one will be recognized).
.SH OPERANDS
The following operands are supported:
.TP 8
.IR file (s)
The path name(s) of one or more input files.  They must be
valid MPEG-1/2 audio layer-1, -2 or -3 bit streams.
If a dash ``\-'' is specified, MPEG data will
be read from the standard input.  Furthermore, any name
starting with ``http://'' is recognized as
.I URL
(see next section).
.SH HTTP SUPPORT
In addition to reading MPEG audio streams from ordinary
files and from the standard input,
.B mpg123
supports retrieval of MPEG audio files via the HTTP protocol, 
which is used in the World Wide Web (WWW).  Such files are
specified using a so-called URL (universal resource
location), which starts with ``http://''.  When a file with
that prefix is encountered,
.B mpg123
attempts to open an HTTP connection to the server in order to
retrieve that file to decode and play it.
.P
It is often useful to retrieve files through a WWW cache or
so-called proxy.  To accomplish this,
.B mpg123
examines the environment for variables named
.BR MP3_HTTP_PROXY ", " http_proxy " and " HTTP_PROXY ,
in this order.  The value of the first one that is set will
be used as proxy specification.  To override this, you can
use the
.B \-p
command line option (see the ``OPTIONS'' section).  Specifying
.B "\-p none"
will enforce contacting the server directly without using
any proxy, even if one of the above environment variables
is set.
.P
Note that, in order to play MPEG audio files from a WWW
server, it is necessary that the connection to that server
is fast enough.  For example, a 128 kbit/s MPEG file
requires the network connection to be at least 128 kbit/s
(16 kbyte/s) plus protocol overhead.  If you suffer from
short network outages, you should try the
.B \-b
option (buffer) to bypass such outages.  If your network
connection is generally not fast enough to retrieve MPEG
audio files in realtime, you can first download the files
to your local harddisk (e.g. using
.BR lynx (1))
and then play them from there.
.SH INTERRUPT
You can abort
.B mpg123
at any time by pressing Ctrl-C.  If you are playing multiple
files, this will stop the current file and begin playing the
next one.  If you want to abort playing immediately instead
of skipping to the next file, press Ctrl-C twice in short
succession (within about one second).
.P
Note that the result of pressing Ctrl-C might not be audible
immediately, due to audio data buffering in the audio device.
This delay is system dependent, but it is usually not more
than one or two seconds.
.SH "SEE ALSO"
.BR lynx (1),
.BR sox (1),
.BR intro (1)
.SH NOTES
MPEG audio decoding requires a good deal of CPU performance,
especially layer-3.  To decode it in realtime, you should
have at least a Pentium, Alpha, SuperSparc or equivalent
processor.  You can also use the
.B -singlemix
option to decode mono only, which reduces the CPU load
somewhat for layer-3 streams.  See also the
.BR \-2 " and " \-4
options.
.P
If everything else fails, use the
.B \-s
option to decode to standard output, direct it into a file
and then use an appropriate utility to play that file.
You might have to use a tool such as
.BR sox (1)
to convert the output to an audio format suitable for
your audio player.
.P
Also note that
.B mpg123
always generates 16 bit stereo data (if one of the
.BR \-single *
options is used, two identical stereo channels are
generated).  If your hardware requires some other
format, for example 8 bit mono, you also have
to use a converter such as
.BR sox (1).
.P
If your system is generally fast enough to decode in 
realtime, but there are sometimes periods of heavy 
system load (such as cronjobs, users logging in remotely, 
starting of ``big'' programs etc.) causing the 
audio output to be interrupted, then you should use
the
.B \-b
option to use a buffer of at least 1000 Kbytes.
.SH BUGS
.TP
Known bugs and limitations:
.br
MPEG-2, Layer 1 and 2 not tested. May not work. (Layer 3 should work.)
.br
Free format streams are not supported.
.br
Layer-1 support is not heavily tested.
.br
No CRC error checking is performed.
.br
There is currently no support for audio hardware on
DEC Digital Unix, Ultrix and IBM AIX, therefore the
.B \-s
option has to be used on those platforms.
.SH AUTHORS
.TP
Main author:
.br
Michael Hipp <Michael.Hipp@student.uni-tuebingen.de>
.TP
Uses code (or at least ideas) from:
.br
MPEG Software Simulation Group (Base package)
.br
Philipp Knirsch <phil@mpik-tueb.mpg.de> (DCT36/manual unroll)
.br
Tobias Bading <bading@cs.tu-berlin.de> (subband synthesis)
.br
Jeff Tsay <ctsay@pasteur.eecs.berkeley.edu> (DCT36)
.br
Thomas Woerner (SGI Audio)
.br
Damien Clermonte <clermond@esiee.fr> (HP-UX audio fixes)
.br
Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>
.P
Internet references:
.br
http://www.sfs.nphil.uni-tuebingen.de/~hipp/mpg123.html
.br
http://www.heim3.tu-clausthal.de/~olli/mpg123/
.br
(includes information about the mpg123 mailing list)
.P
The latest version is also available from here:
.br
ftp.tu-clausthal.de:/pub/unix/audio/mpg123
.br
http://ftp.tu-clausthal.de/pub/unix/audio/mpg123