Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: setting up "mp3 box" using mpg123< Next Oldest | Next Newest >
ShiZzl3 Offline





Group: Members
Posts: 3
Joined: Feb. 2006
Posted: Feb. 26 2006,14:24 QUOTE

hi!

i just installed DSL on a little maschine without any IDE devices, so its runnig from USB, booted from floppy disk. soundcard and network card plugged in, for the moment a graphic card is installed to, will be removed after configuration. Well, what i want to do now, is write a script to read pressed keys and control mpg123, in the way that the script reads all mp3s from a predefined folder, and when i press, lets say, the "P" key, it starts playing the first one, on key press "N" the next one in the directory.

i searched a bit and also found something that worked on my main maschine, but it uses "screen" that is not avaible on DSL

so i aks you, do you have any idea how this could be made??
i hope so :P

Greetings ShiZzl3

-------------
PS: i'm not running X, if it is for any interest
PS2: i'm german, so i apologize for my bad english :P
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Feb. 27 2006,05:47 QUOTE

sudo su
apt-get install screen

Or maybe start up Synaptic and choose to install screen.
Back to top
Profile PM 
Ruthje Offline





Group: Awaiting Authorisation
Posts: 17
Joined: Aug. 2005
Posted: Feb. 27 2006,11:36 QUOTE

I've made a screen.dsl you can find it under mydsl->wm_apps. It works for me. I'm using it also for a headless mp3-box. But I use it to control via ssh a program called mp3blaster. With screen I don't have to keep a session open. If you succeed to let your script work on dsl I'll be interessed.
Back to top
Profile PM 
ShiZzl3 Offline





Group: Members
Posts: 3
Joined: Feb. 2006
Posted: Feb. 27 2006,15:42 QUOTE

i finally gave up trying to  find a solution with mpg123...it would be too much scripting work at all...although i managed to install screen,thx for the mydsl plugin!

even if i didnt want to take it cause of my old maschine, i installed the mplayer.dsl and wrote a very simple script to create a playlist for it. mplayer itselfs includes everything i need like play/pause, skip and volume controls via keyboard.

so i put this script into $PATH and are now able to search mp3s and play them or whole folders etc.
Code Sample
#check if one commandline option is given, else exit
if [ -z "$1" ]; then
echo usage: $0 directory [searchstring] [shuffle] [add]
exit
fi

#Pre define Folder and NULL files
DIR=$1

#check if searchstring is * , cause * cant be as normal opperator, must be Space
if [ "$2" = "*" ];then
SS=""
else
SS=$2
fi

FILES=""

#get mp3 file list
if [ "$4" = "add" ];then # if add=true,add to preexisting file, else create new one
find $DIR -name \*$SS*.mp3 >> files.txt
else
find $DIR -name \*$SS*.mp3 > files.txt
fi

#create string to hand over to mplayer though handing over filelist wont work
while read FILENAME
do
 FILES=$FILES" "$FILENAME
done < files.txt

#execute mplayer with found files
if [ "$3" = "shuffle" ];then #shuffle requested??
mplayer -z $FILES
else  
mplayer $FILES
fi

and yes..i found some very interestings frontends for mpg123 that looked quite the same than your mp3blaster, but the problem is that i want to use it headless, and without another maschine, so i want to control it without seeing any graphical output...thats why such a frontend doesnt work for me.

thx for your help...i think i will install mp3blaster , too.....for later use maybe :P

Greetz
ShiZzl3

PS: dont wonder about the script, its not perfect at all...i started writing scripts in bash some days ago :D
Back to top
Profile PM 
Ruthje Offline





Group: Awaiting Authorisation
Posts: 17
Joined: Aug. 2005
Posted: Feb. 28 2006,14:41 QUOTE

Ik think you can use mp3blaster without seeing anything. Just remember that "5" is play and "6" is next and ">" is volume up. But how do you create your playlist without seeing what you're doing? I never wrote a bash-script so maybe I just don't understand the sript. I think what you're trying is the same as I've in mind with my mp3box. So I hope you can keep me informed about your progress?
Back to top
Profile PM 
8 replies since Feb. 26 2006,14:24 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: setting up "mp3 box" using mpg123

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code