MAN page from RedHat Other mpg123-0.59o-1.i386.rpm
mpg123
Section: User Commands (1)
Updated: 21 Apr 1997
Index NAME
mpg123 - play audio MPEG 1.0/2.0 file (layers 1, 2 and 3)
SYNOPSIS
mpg123[
-tscvqy01m24][
-b size][
-k num][
-n num][
-f factor][
-r rate][
-g gain][
-a dev][
-o s |
-o h |
-o l][
-d n][
-h n][
-p proxy][
-@ file]
file ... |
URL ... |
- DESCRIPTION
mpg123reads one or more
files(or standard input if ``-'' is specified) or
URLsand plays them on the audio device (default) oroutputs them to stdout.
file/
URLis assumed to be an MPEG-1/2 audio bit stream.
OPTIONS
mpg123options may be either the traditional POSIX one letter options,or the GNU style long options. POSIX style options start with asingle ``-'', while GNU long options start with ``--''.
- -t, --test
- Test mode. The audio stream is decoded, but no output occurs.
- -s, --stdout
- The decoded audio samples are written to standard output,instead of playing them through the audio device. Thisoption must be used if your audio hardware is not supportedbympg123.The output format is raw (headerless) linear PCM audio data,16 bit, stereo, host byte order.
- -c, --check
- Check for filter range violations, and report them for each frameif any occur.
- -v, --verbose
- Increase the verbosity level. For example, displays the framenumbers during decoding.
- -q, --quiet
- Quiet. Suppress diagnostic messages.
- -y, --resync
- Try to resync and continue decoding if an error occurs inthe input file. Also try to recover from certain brokenheaders. Useful if you have a broken MPEG file, on whichmpg123normally gives up saying `Illegal header'. Be careful:Broken locations in MPEG files might cause sharp, loud pops orclicks, which might damage your speakers if played too loud.
- -0, --single0; -1, --single1
- Decode only channel 0 (left) or channel 1 (right),respectively. These options are available forstereo MPEG streams only.
- -m, --singlemix
- Mix both channels. This option is available forstereo MPEG layer-3 streams only. It takes lessCPU time than full stereo decoding.
- -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.
- -b size, --buffer size
- Use an audio output buffer ofsize
Kbytes. This is useful to bypass short periods of heavysystem 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.- -k num, --skip num
- Skip firstnum
frames. By default the decoding starts at the first frame.- -n num, --frames num
- Decode onlynum
frames. By default the complete stream is decoded.- -f factor, --scale factor
- Change scale factor (default: 32768).
-r rate, --rate rate- Set sample rate (default: automatic). You may want tochange this if you need a constant bitrate independed ofthe mpeg stream rate. mpg123 automagically converts therate. You should then combine this with --stereo or --mono.
-g gain, --gain gain- Set audio hardware output gain (default: don't change).
-a dev, --audiodevice dev- Specify the audio device to use. The default issystem-dependent (usually /dev/audio or /dev/dsp).Use this option if you have multiple audio devices andthe default is not what you want.
-o s, --speaker - Direct audio output to the speaker.
- -o h, --headphones
- Direct audio output to the headphone connector.
- -o l, --lineout
- Direct audio output to the line-out connector.
- -d n, --doublespeed n
- Only play everyn
'thframe. This will cause the MPEG streamto be playedntimes faster, which can be used for specialeffects. Can also be combined with the--halfspeedoption to play 3 out of 4 frames etc. Don't expect greatsound quality when using this option.- -h n, --halfspeed n
- Play each framen
times. This will cause the MPEG streamto be played at1/n'thspeed (n times slower), which can beused for special effects. Can also be combined with the--doublespeedoption to double every third frame or things like that.Don't expect great sound quality when using this option.- -p URL | none, --proxy URL | none
- The specified
proxywill be used for HTTP requests. Itshould be specified as full URL (``http://host.domain:port/''),but the ``http://'' prefix, the port number and the trailingslash are optional (the default port is 80). Specifyingnonemeans not to use any proxy, and to retrieve files directlyfrom the respective servers. See also the``HTTP SUPPORT'' section.- -u auth, --auth auth
- HTTP authentication to use when recieving files via HTTP.The format used is user:password.
-@ file, --list file- Read filenames and/or URLs of MPEG audio streams from the specifiedfile
in addition to the ones specified on the command line (if any).Note thatfilecan be either an ordinary file, a dash ``-'' to indicate thata list of filenames/URLs is to be read from the standard input,or an URL pointing to a an appropriate list file. Note: onlyone-@option can be used (if more than one is specified, only thelast one will be recognized).- -z, --shuffle
- Shuffle play. Randomly shuffles the files specified on the command lineand in the list file.
- --stereo
- Force stereo output
- --reopen
- Forces reopen of the audiodevice after ever song
- --8bit
- Forces 8bit output
- -Z, --random
- Full random play
OPERANDS
The following operands are supported:
- file(s)
- The path name(s) of one or more input files. They must bevalid MPEG-1/2 audio layer-1, -2 or -3 bit streams.If a dash ``-'' is specified, MPEG data willbe read from the standard input. Furthermore, any namestarting with ``http://'' is recognized asURL(see next section).
HTTP SUPPORT
In addition to reading MPEG audio streams from ordinaryfiles and from the standard input,
mpg123supports retrieval of MPEG audio files via the HTTP protocol, which is used in the World Wide Web (WWW). Such files arespecified using a so-called URL (universal resourcelocation), which starts with ``
http://''. When a file withthat prefix is encountered,
mpg123attempts to open an HTTP connection to the server in order toretrieve that file to decode and play it.
It is often useful to retrieve files through a WWW cache orso-called proxy. To accomplish this,mpg123examines the environment for variables namedMP3_HTTP_PROXY, http_proxy and HTTP_PROXY,in this order. The value of the first one that is set willbe used as proxy specification. To override this, you canuse the-pcommand line option (see the ``OPTIONS'' section). Specifying-p nonewill enforce contacting the server directly without usingany proxy, even if one of the above environment variablesis set.
Note that, in order to play MPEG audio files from a WWWserver, it is necessary that the connection to that serveris fast enough. For example, a 128 kbit/s MPEG filerequires the network connection to be at least 128 kbit/s(16 kbyte/s) plus protocol overhead. If you suffer fromshort network outages, you should try the-boption (buffer) to bypass such outages. If your networkconnection is generally not fast enough to retrieve MPEGaudio files in realtime, you can first download the filesto your local harddisk (e.g. usinglynx(1))and then play them from there.
If authentication is needed to access the file it can bespecified with the .B "-u user:pass".
INTERRUPT
You can abort
mpg123at any time by pressing Ctrl-C. If you are playing multiplefiles, this will stop the current file and begin playing thenext one. If you want to abort playing immediately insteadof skipping to the next file, press Ctrl-C twice in shortsuccession (within about one second).
Note that the result of pressing Ctrl-C might not be audibleimmediately, due to audio data buffering in the audio device.This delay is system dependent, but it is usually not morethan one or two seconds.
SEE ALSO
lynx(1),
sox(1),
intro(1)
NOTES
MPEG audio decoding requires a good deal of CPU performance,especially layer-3. To decode it in realtime, you shouldhave at least a Pentium, Alpha, SuperSparc or equivalentprocessor. You can also use the
-singlemixoption to decode mono only, which reduces the CPU loadsomewhat for layer-3 streams. See also the
-2 and
-4options.
If everything else fails, use the-soption to decode to standard output, direct it into a fileand then use an appropriate utility to play that file.You might have to use a tool such assox(1)to convert the output to an audio format suitable foryour audio player.
Also note thatmpg123always generates 16 bit stereo data (if one of the-single*options is used, two identical stereo channels aregenerated). If your hardware requires some otherformat, for example 8 bit mono, you also haveto use a converter such assox(1).
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 usethe-boption to use a buffer of at least 1000 Kbytes.
BUGS
- Known bugs and limitations:
MPEG-2, Layer 1 and 2 not tested. May not work. (Layer 3 should work.)
Free format streams are not supported.
Layer-1 support is not heavily tested.
No CRC error checking is performed.
There is currently no support for audio hardware onDEC Digital Unix, Ultrix and IBM AIX, therefore the-soption has to be used on those platforms.
AUTHORS
- Main author:
Michael Hipp <Michael.HippAATTstudent.uni-tuebingen.de>- Uses code (or at least ideas) from:
MPEG Software Simulation Group (Base package)
Philipp Knirsch <philAATTmpik-tueb.mpg.de> (DCT36/manual unroll)
Tobias Bading <badingAATTcs.tu-berlin.de> (subband synthesis)
Jeff Tsay <ctsayAATTpasteur.eecs.berkeley.edu> (DCT36)
Thomas Woerner (SGI Audio)
Damien Clermonte <clermondAATTesiee.fr> (HP-UX audio fixes)
Oliver Fromme <oliver.frommeAATTheim3.tu-clausthal.de>
Internet references:
http://www.sfs.nphil.uni-tuebingen.de/~hipp/mpg123.html
http://www.heim3.tu-clausthal.de/~olli/mpg123/
(includes information about the mpg123 mailing list)
The latest version is also available from here:
ftp.tu-clausthal.de:/pub/unix/audio/mpg123
http://ftp.tu-clausthal.de/pub/unix/audio/mpg123
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- OPERANDS
- HTTP SUPPORT
- INTERRUPT
- SEE ALSO
- NOTES
- BUGS
- AUTHORS
This document was created byman2html,using the manual pages.