Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
International Medical Corps

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 61 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       mpg123 [ -tscCvqy01m24 ] [ -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 ] [ -u u ] [ -@
       file ] file ... | URL ... | -


       mpg123 reads one or more files (or standard input if ``-''
       is  specified)  or URLs and plays them on the audio device
       (default) or outputs them to stdout.  file/URL is  assumed
       to be an MPEG-1/2 audio bit stream.


       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 ``--''.

       -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.   This  option  must  be used if your audio
              hardware is not supported by  mpg123.   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 frame if any occur.

       -C, --control
              Enable  control  keys.  By default use 's' to stop,
              'p' to pause, 'f' to jump forward to the next song,
              'b'  to jump back to the beginning of the song, ','
              to rewind, '.' to fast forward, and 'q' to quit.

       -v, --verbose
              Increase the verbosity level.   For  example,  dis­
              plays the frame numbers during decoding.

       -q, --quiet
              Quiet.  Suppress diagnostic messages.

       -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 bro­
              ken MPEG file, on which mpg123  normally  gives  up

       -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.  Please  note,  that  does not change
              speed of the song. Ie the --2to1 option is the same
              like  forcing  the sampling output rate to -r 22050
              on a 44.1 kHz song.

       -b size, --buffer size
              Use an audio output buffer of size Kbytes.  This is
              useful  to  bypass  short  periods  of heavy system
              activity, which would normally cause the audio out­
              put 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  first  num  frames.   By default the decoding
              starts at the first frame.

       -n num, --frames num
              Decode only num 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
              to change this if you need a constant  output  rate
              independed of the mpeg stream rate. mpg123 automag­
              ically converts the rate (down/up sampling)  .  You
              should then combine this with --stereo or --mono.

       -g gain, --gain gain
              Set  audio  hardware  output  gain  (default: don't

       -a dev, --audiodevice dev
              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.

       -o s, --speaker
              Direct audio output to the speaker.

       -h n, --halfspeed n
              Play each frame n times.  This will cause the  MPEG
              stream  to  be  played  at  1/n'th  speed  (n times
              slower), which can be used for special effects. Can
              also  be  combined with the --doublespeed option to
              double every  third  frame  or  things  like  that.
              Don't  expect  great  sound quality when using this

       -p URL | none, --proxy URL | none
              The specified 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 none
              means  not  to use any proxy, and to retrieve files
              directly from 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  specified  file  in addition to the ones
              specified on the command line (if any).  Note  that
              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  -@
              option  can be used (if more than one is specified,
              only the last one will be recognized).

       -z, --shuffle
              Shuffle play.  Randomly shuffles the  files  speci­
              fied on the command line and in the list file.

              Force stereo output

              Forces reopen of the audiodevice after ever song

       --8bit Forces 8bit output

       -w, --wav file
              Write  the  song using the WAV format to the speci­
              fied file Instead of a real filename you can use  a
              dash ``-'' to indicate that the data is to be writ­
              ten to standard out.

       In  addition  to  reading MPEG audio streams from ordinary
       files  and  from  the  standard  input,  mpg123   supports
       retrieval of MPEG audio files via the HTTP protocol, which
       is used in the World Wide Web (WWW).  Such files are spec­
       ified using a so-called URL (universal resource location),
       which starts with ``http://''.  When a file with that pre­
       fix  is  encountered, mpg123 attempts to open an HTTP con­
       nection to the server in order to retrieve  that  file  to
       decode and play it.

       It  is  often useful to retrieve files through a WWW cache
       or so-called proxy.  To accomplish this,  mpg123  examines
       the   environment   for  variables  named  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 specifica­
       tion.  To override this, you can use the -p  command  line
       option  (see the ``OPTIONS'' section).  Specifying -p none
       will enforce contacting the server directly without  using
       any  proxy, even if one of the above environment variables
       is set.

       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 option
       (buffer) to bypass such outages.  If your network  connec­
       tion  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 lynx(1)) and then play
       them from there.

       If authentication is needed to access the file it  can  be
       specified with the -u user:pass.


       You  can  abort 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

       Note that the result of pressing Ctrl-C might not be audi­
       ble  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.


       lynx(1), sox(1), intro(1)

       Also  note that mpg123 always generates 16 bit stereo data
       (if one of the -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 sox(1).

       If your system is generally fast enough to decode in real­
       time, 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 option to use a
       buffer of at least 1000 Kbytes.


       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 on
              DEC Digital Unix, Ultrix and IBM AIX, therefore the
              -s option has to be used on those platforms.


       Main author:
              Michael Hipp <hippm@informatik.uni-tuebingen.de>

       Uses code (or at least ideas) from:
              MPEG Software Simulation Group (Base package)
              Philipp Knirsch <phil@mpik-tueb.mpg.de> (DCT36/man­
              ual unroll)
              Tobias  Bading  <bading@cs.tu-berlin.de>   (subband
              Jeff Tsay <ctsay@pasteur.eecs.berkeley.edu> (DCT36)
              Thomas Woerner (SGI Audio)
              Damien Clermonte <clermond@esiee.fr>  (HP-UX  audio
              Oliver Fromme <oliver.fromme@heim3.tu-clausthal.de>

       Internet references:
       (includes information about the mpg123 mailing list)

       The latest version is also available from here:

Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can help in many different ways.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.08 Seconds