LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   create a directory of mp3 using lame (https://www.linuxquestions.org/questions/slackware-14/create-a-directory-of-mp3-using-lame-776445/)

zeelog 12-17-2009 10:11 AM

create a directory of mp3 using lame
 
I have a directory full of .wav files that I want to convert
to mp3 using the command lame -h
I can't figure out how to do it. Ok, so I'm not all that bright,
but I know there must be a way. Does anyone know how to do this?
This is in Slackware 12 and, sometimes, in Slackware 10.

Person_1873 12-17-2009 10:30 AM

i suppose you could do something like
Code:

#lame /directory/to/music/*.wav /directory/to/mp3s/*.mp3
but thats off the top of my head, you may want them in the same folder in which case dw about the second argument

GazL 12-17-2009 10:46 AM

I'm not sure that will work for lame. I don't believe you can have multiple infiles/outfiles like that. (but I could be wrong)

A for loop will probably do it
Code:

for wavfile in *.wav
do
  lame "$wavfile" "${wavfile/.wav}.mp3"
done


Person_1873 12-17-2009 11:04 AM

open your favorite text editor such as gedit or kate and copy the following into it
Code:

#!/bin/bash
for wavfile in ./*.wav
do
  lame "$wavfile" "${wavfile/.wav}.mp3"
done

save the file as whatever you like in the directory where your music is saved

you then need to make the file executable by running
Code:

chmod +x filename
you may then double click the file and it will run


All times are GMT -5. The time now is 12:17 PM.