LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Playlists in Mpg123 (https://www.linuxquestions.org/questions/linux-software-2/playlists-in-mpg123-144637/)

beajedi 02-10-2004 08:05 PM

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?

mikshaw 02-10-2004 11:31 PM

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.
Code:

#  your CDRom device
DRIVE=/dev/cdrom

#  CDRom mountpoint
DIR=/media/cdrom

#  this is where you store the playlist
PLAYLIST=/tmp/mp3playlist

#  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)"


notAslacker 02-11-2004 01:12 PM

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 :p

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:

:scratch:

#begin file, no comments just paths to tunes
/home/X/music//song1.mp3
/home/X/music//song2.mp3
/home/X/music//song3.mp3
#...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.

-notaslacker

mikshaw 02-11-2004 02:37 PM

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.


All times are GMT -5. The time now is 03:21 AM.