Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-10-2004, 08:05 PM   #1
Registered: Jan 2003
Distribution: Slackware 9.1
Posts: 67

Rep: Reputation: 15
Playlists in Mpg123

I will be getting an old laptop (P200 w/32 megs RAM) and I want to install either slackware or debian on it.

Basically, I want it to be a glorified MP3 player, and an internet browser. I will probably install fluxbox or whatever on it.

I was messing around with MPG123, and I read in the man pages that you can play playlists (!).

What does an MPG123 playlist look like (I didn't see an example in the man pages), and would I be able to play Xmms playlists with mpg123?
Old 02-10-2004, 11:31 PM   #2
LQ Addict
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
It's just a list of files, nothing more.

If you have a directory with a pile of mp3s, you can quickly build a list with a command like this:
find ${DIR} -iname "*.mp3" >> ${PLAYLIST}

I wrote a tiny script for mp3 CDs a short while ago which mounts the CD, builds a playlist from its contents, and then launches a player. If you take out the CD stuff it should work the same for any mp3 directory. You're free to mess around with it if you want.
#  your CDRom device

#  CDRom mountpoint

#  this is where you store the playlist

#  this is your chosen player.  You can either
#  add options to this variable, or enter them 
#  on the command line when you summon mp3cd.
#PLAYER="mpg123 -v -@ ${PLAYLIST}"
PLAYER="mpg321 -v -@ ${PLAYLIST}"

#  mounts the cdrom
#  If your drive is not set up with "user" option
#  in /etc/fstab, you'll need to use the "su" line below.
#echo "
#enter root password to mount ${DRIVE}"
#su -c "mount ${DRIVE}"
mount ${DRIVE}

#  creates a list of mp3s from the CD
cat /dev/null > ${PLAYLIST}
find ${DIR} -iname "*.mp3" >> ${PLAYLIST}

#  launch the player
${PLAYER} $@

#echo "
#enter root password to unmount ${DRIVE}"
#su -c "umount ${DRIVE}"
umount ${DRIVE}
echo "
Thanks for playing! =o)"
Old 02-11-2004, 01:12 PM   #3
LQ Newbie
Registered: Jul 2003
Posts: 16

Rep: Reputation: 0
playlists in mpg123

For an ncurses frontend to mpg321/123 you could use mjs(mp3 jukebox system). They also have a patched mpg123 to help pause/resume type controls. It plays nice insofar as I've used it. No random reboots or smoke billowing from the speakers

Another frontend is PyTone, which has more versatility in playlist formats and remote player access. It looks like mjs, maybe a little nicer, also with curses interface.

Also, as for the mpg123/321 list format, I can only get a filelist to roll if I use an extra slash strategically, eg:

#begin file, no comments just paths to tunes
#...and so on, end file

You could use a script like above to generate them and/or add code to convert xmms to mpg123 style lists.

If you want to take it to extremes, there is some info around on google about hooking up stereo equipment and using mpg321 and some other progs as a core for a freaky jukebox system with all manner of files/media.

Old 02-11-2004, 02:37 PM   #4
LQ Addict
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
I just noticed the ">>" in my script. This won't cause any problems, but it technically should be a single ">". The double (append) was carried over from a previous script where I had the command in a loop searching for multiple file types.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run mpg123: system("mpg123"); How to know what PID it gets? And a Emacs highlightin q kornerr Programming 10 08-06-2005 10:17 AM
XMMS made M3U playlists rael_kid Linux - Newbie 6 06-01-2005 10:52 AM
HTML Playlists Altec_ Linux - Software 0 02-14-2005 09:30 PM
Totem playlists are a mystery. Louis_Carole Linux - Software 0 01-12-2005 08:45 PM
kplayer doesn't import m3u playlists tk31337 Linux - General 0 11-16-2003 04:41 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration