The Linux MP3-HOWTO : Listening to MP3's.

Next Previous Contents

## 12. Listening to MP3's.

So, hopefully, you should now have some MP3 files ready to listen to, and have the choice of playing from file or stream.

## 12.1 Playing from File

Playing from file is reasonably straight-forward with all players. The only big difference is some are command-line based and some are X based.

Playing an MP3 file from file requires you to pass the mp3 file as a parameter, like so:

    [dj@megajukebox]$ mpg123 /mp3_files/SampleFile.mp3

    or

    [dj@megajukebox]$ xaudio /mp3_files/SampleFile.mp3

If you want to play a series of files, pass them in as a list:

    [dj@megajukebox]$ alsaplayer /mp3_files/SampleFile1.mp3 /mp3_files/SampleFile2.mp3

To play all the tracks in a directory, just wildcard the file selected, like so:

    [dj@megajukebox]$ xmms /mp3_files/*.mp3

## 12.2 Playing from MP3 Streams

Playing from a MP3 stream is quite easy, just replace the file with the streams url and port number:

    [dj@megajukebox]$ mpg123 http://localhost:8000

    or

    [dj@megajukebox]$ freeamp http://megajukebox:2711

## 12.3 Capturing MP3 Streams

A stream from a MP3 server can be captured and save locally using the following:

### Streamripper

To capture an MP3 stream using streamripper, type the following:

    [dj@megajukebox]$ streamripper -h megajukebox -p 8000
    Press CTRL-C to stop
    name: Megajukebox
    reponse: 200
    genre: Megajukebox
    url: http://www.megajukebox.com/
    bitrate: 128
    This stream contains no meta data, ripping as one large ass track
    1st track ripped
    socket error: : Success

Here's a list of options.

    [dj@megajukebox]$ streamripper
    Usage: streamripper -h <host> -p <port> [-d dir]
    Options:
            -h <host>      - Required: The host name
            -p <port>      - Required: The host port, typically 8000
            -d <dir>       - Optional: The destination directory
            -l <logfile>   - Optional: Output everything to a log file <logfile>
            -v             - Optional: Be extra verbose
            -c             - Optional: Don't display status counter
            -q             - Optional: Quiet mode, don't make mp3 files
            -s             - Optional: Output stream to stdout for mpg123
            -n             - Optional: Wait until next track before writing
            -o             - Optional: Create a directory with the stream name for output

### wget

To save a stream using wget:

    [dj@megajukebox]$ wget http://megajukebox:8000 -O download01.mp3
    --13:41:41--  http://megajukebox:8000/
               => `download01.mp3'
    Connecting to megajukebox:8000... connected!
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [audio/mpeg]

        0K -> .......... .......... .......... .......... ..........
       50K -> .......... .......... .......... .......... ..........
      100K -> .......... .......... .......... .......... ..........
      150K -> .......... .......... .......... .......... ..........
      200K -> .......... .......... .......... .......... ..........
      250K -> .......... .......... .......... .......... ..........
      300K -> .......... .......... .......... .......... ..........
      350K -> .......... .......... .......... .......... ..........
      400K -> .......... .......... .......... .......... ..........
      450K -> .......... .......... .......... .......... ..........
      500K -> .......... .......... .......... .......... ..........

## 12.4 Mixing

### eMixer

eMixer gives you the ability to mix MP3's in a similar manner to a DJ's mixing desk.

Newer versions support 2 sound cards so you can output your mix on one card and monitor or cue the next track on another.

As usual once untaring, read the readme on how to build the package.

You will need to create a playlist of MP3 files, do this with the find command mentioned in the Streaming section.

You will need mpg123 installed before you can run eMixer.

Here are the control keys (taken from the readme)

    KEYBOARD CONTROLS
    "up, down"              scroll thru playlist
    "page up, page down"    scroll thru playlist screen full at a time
    "enter"                 start/stop track
    "tab"                   change channel
    "}","]"                 toggle between volume and speed controls/windows
    "space"                 restart active track
    "left, right"           fader controls
    "insert"                decrease volume/speed in channel one
    "home"                  increase volume/speed in channel one
    "delete"                decrease volume/speed in channel two
    "end"                   increase volume/speed in channel two
    "< , / , >"             left, center & right positions of fader
    " + , = "       (NEW)   switch between faders
    " q "                   start/stop channel channel one
    " w "                   start/stop channel channel two
    " p "                   toggle between playmodes - single, loop, continuous, random
    " a "                   stop all channels
    " f "                   file menu
    " u "                   util menu
    " h "                   help menu
    " ~, ` "                cancel menu drop down
    " s "                   turn SIM Play on
                            (SIM Play starts the same track in both channels
                            simultaneously )

### GDAM

GDAM is a GUI based MP3 mixer with a large bank of built in, real-time effects.

Next Previous Contents