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: (7) </ 1 2 3 [4] 5 6 7 >/

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

reply to topic new topic new poll
Topic: XMMS Improvements, Additional plug-in for WMA< Next Oldest | Next Newest >
jot Offline





Group: Members
Posts: 15
Joined: May 2006
Posted: May 19 2006,22:30 QUOTE

This is my first post so there it goes 'Hello all' :)

lesliek if You wish I can help You with this script. Ok, so first thing, if You want to substitute the output plugin in 'config' file You can do it like this:

sed -i '/output_plugin/s/OSS/disk_writer/' /home/dsl/.xmms/config

then

xmms -p "$1"

when it ends You will have to close xmms manually

the next line :

lame "${1/wma/wav}" "${1/wma/mp3}"

to restore the old config :

sed -i '/output_plugin/s/disk_writer/OSS/' /home/dsl/.xmms/config

But i don't think you can fully automate it with just bare xmms...
unless You use xmmsctrl , You can find rpm here: [url="http://rpm.pbone.net/index.php3/stat/4/idpl/1521354/com/xmmsctrl-1.8-1mdk.i586.rpm.html"]xmmsctrl RPMs[\url].

It gives you more commandline control over xmms.

I'll try to write a script with use of xmmsctrl and post it here.

If You have more questions, just ask.

@mikshaw :
i know sed a bit , but the i option is new to me, and I'm glad You've mentioned it. Previousl I used:

sed 's/x/y' file > a ; mv a file

Now life will be easier :)
Thanks
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 19 2006,22:55 QUOTE

Quote (jot @ May 19 2006,18:30)
when it ends You will have to close xmms manually

Or you can add the command killall xmms to the script.  This may be a harsh way to close it (i don't understand signals very well), but it works.

--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
lesliek Offline





Group: Members
Posts: 91
Joined: Feb. 2006
Posted: May 20 2006,02:24 QUOTE

Many thanks to both jot and mikshaw, whose posts I've just been able to read. I'm away from my DSL computer for the next 24 hours, but will get back to this as soon as I'm with the computer again.

Leslie
Back to top
Profile PM 
lesliek Offline





Group: Members
Posts: 91
Joined: Feb. 2006
Posted: May 21 2006,09:45 QUOTE

Well, I've now had some time to play with this and have reached the following point:

#!/bin/bash

sed -i "s/libOSS.so/libdisk_writer.so/g" ~/.xmms/config

#process=xmms
#t=`pidof $process`

for i in *.wma
do
       filename=`basename "$i" .wma`
       echo "Ripping $i"
       xmms "$i"
#kill $t
killall xmms
       lame "${i/wma/wav}" "${i/wma/mp3}"

done

sed -i "s/libdisk_writer.so/libOSS.so/g" ~/.xmms/config

I already knew that the opening and closing lines worked properly to change the XMMS output plugin from OSS to Disk Writer and then back again and so I didn't try jot's alternative. I did, however, use his line for lame, changing the 1 to an i, since I'd already been using i.

The most serious problem I have with the rest of the script is that I can't yet stop XMMS from within the script. I tried mikshaw's suggestion of killall xmms (the way the script above is written). It didn't work for me.

I tried something else from a bash script I found on the Web called kill-process.sh, which I've commented out above, namely:

process=xmms
t=`pidof $process`
kill $t

It didn't work for me either and I don't understand enough about these things to know why not.

One other problem is less serious.

I'm left at the end of the process with three files, Beethoven.wma (a minute long extract I already had, which I'm using for test purposes), Beethoven.wav and Beethoven.mp3.

In his post, jot mentioned xmmsctrl. I had tried that, but with disastrous results.  For a reason I've now repressed, I'd decided I couldn't try to get anything useful out of the rpm of it, so I thought I'd try to compile the source code. To do that, I needed to download a dsl (gcc?). After I'd done that and rebooted, I ran out of space while the extensions were being loaded at bootup and had to use a rescue disk to get rid of the new dsl before I could get things back on track.

I'd appreciate very much any advice about how I can stop xmms from within the script and also about how I can automatically get rid of any .wav files produced in the course of the conversion process.

Many thanks for the help already extended,

Leslie

PS As two of the lines in the script appear above, they're not quite correctly formatted. I can't figure out how to fix them in this post. Apologies for that.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 21 2006,14:35 QUOTE

lame "${i/wma/wav}" "${i/wma/mp3}" && rm -f ${i/wma/wav}

I'm not sure why xmms is not closing.  I know that getting the pid of an app before actually running it isn't going to work, but I don't know why killall doesn't force it to close.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
33 replies since Nov. 27 2005,21:03 < Next Oldest | Next Newest >

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

Pages: (7) </ 1 2 3 [4] 5 6 7 >/
reply to topic new topic new poll
Quick Reply: XMMS Improvements

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