Command-Line Streaming MP3 Player
Use basic command-line tools to create your own streaming MP3 player.
When setting up Obsequeium (http://obsbox.sf.net) or Jinzora (http://jinzora.org) web jukeboxes [Hack #84] , I’ve found it helpful to set up a dedicated streaming player so I can listen to my net jukebox constantly while testing. Preferably the MP3 stream should never stop and, should something happen to the playback, it should pause for a moment and try the stream again. It may seem the mpg123/mpg321 command-line players are perfect for this task, but they have a habit of locking up and not exiting or retrying when something goes wrong with the stream. This makes them unsuitable for use as dedicated streaming players.
You can build a robust command-line streaming player with one command if you have madplay and wget installed. wget and madplay are both popular programs and should be prepackaged by your Linux distribution. Use your distribution’s software installation tool to install these programs. If for some reason you don’t have these tools prepackaged, download the tarballs from http://www.underbit.com/products/mad/ and http://www.gnu.org/software/wget/wget.html, compile, and install them according to the included installation instructions.
With wget and madplay installed, the following command will play the stream from http://example.com/mystream:
$ wget–q–O–http://example.com/mystream| madplay -Q --no-tty-control-
wget reads the MP3 stream and quietly writes it to