Jump to content

Prob: kde servicemenu script calling lame


Recommended Posts

Mandrake has a nice package: kdebase-servicemenus which adds more 'actions' when you are right clicking on a file or folder. Five of those let you encode/decode mp3/wav/ogg/mpg within konqueror as file manager.

 

The problem: they don't work for files with 'spaces' in the filename, and most ripped files have this format, eg:

 

artist - my song.mp3

(while artist-mysong.mp3 works perfectly)

 

Example of a line in one of the servicemenu script (/usr/share/apps/konqueror/servicemenus/lame-decode.desktop):

Exec=lame --decode %f `echo %f | sed 's/\\\\\\\\.mp3$$//'`.wav

 

Can anyone help me to change this command so that it identifies 'artist - my song.mp3' as ONE filename.

 

I can't code or script and don't know what %f or | sed 's/\\\\\\\\ means :-[

Link to comment
Share on other sites

  • 2 weeks later...

Comment out this line:

Exec=lame --decode %f `echo %f | sed 's/\\\\\\\\.mp3$$//'`.wav

like this:

#Exec=lame --decode %f `echo %f | sed 's/\\\\\\\\.mp3$$//'`.wav

 

and try this:

music=$(echo %f | sed 's/\ /\_/g')

Exec=lame --decode $music `echo $music | sed 's/\\\\\\\\.mp3$$//'`.wav

Link to comment
Share on other sites

Thx, Steve :-)

 

Tried that. - Errors out in a kde window, now all mp3 files even without spaces, with: (translated)

'Can't find program: lame --decode $music `echo $music | sed 's/\\\\\\\\.mp3$$//'`.wav

 

The original line errored out only when using on files with spaces in the name with:

'Can't find program lame --decode %f `echo %f | sed 's/\\\\\\\\.mp3$$//'`.wav'

Link to comment
Share on other sites

I've fiddled with it a little so far and I've gotten it to not give me an error and it says it is encoding, but when it's done, there is no .wav file in the directory that I can see. I'll keep you posted. Hmmmm...as a matter of fact, when I do it on a filename without any spaces using the unedited script, it doesn't make the *.wav file as far I can find. Is there some secret place it sends them to?

Edited by Steve Scrimpshire
Link to comment
Share on other sites

The unedit script works here with the non-space filenames, the .wav file is placed in the same dir as the orig. mp3 file, and then gets the name <mysong.mp3.wav> (haha)

 

Do you use a different version maybe - all I do is, in konqueror as filemanager right click on the mp3 file, choose actions --> decode to wav, done. And I see the new wav file.

 

You sure you have lame installed?

 

Will try the new line ...

Edited by anna
Link to comment
Share on other sites

I've tried everything and only know of a workaround. Make sure that none of the directories in the path to the ripped mp3s contain spaces either. Open a console and cd to the directory containing the ripped files and run:

 

find . -name "* *" -exec sh -c 'mv "${0}" "${0// /_}"' {} \;

 

( Command thanks to aru and JoeronM: http://mandrakeusers.org/index.php?showtopic=10556 )

 

That changes all spaces in all the filenames in your current directory to _. Then you can run the right-click "Encode..." function in konqueror. The problem that I had was the there was a parent directory of my mp3s that also had a space, so it wouldn't work for me even for files with no spaces, because the path contained a space (%f contains the whole path and not just the filename). I hope this is understandable.

Edited by Steve Scrimpshire
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...