Operating Systems > Linux and UNIX

Converting multiple files to mp3

(1/6) > >>

Agent007:
hi all,

I have about 100 wav files in a folder....Need to convert them to mp3. I'm using lame to do the conversion.

The systax used is:-

#lame   --preset extreme artist.wav artist.mp3

After each song is over, I have to keep changing the song names. Is it possible to make lame automatically goto the next wav file and select the same name for the mp3 file? until all the wav files are over?

thanks,
007

Master of Reality:
a simple bash script will do it for you. I'm not very experienced with bash scripts so i'm not sure how to do it.

Stryker:
how about:

find -name "*.mp3" | while read item; do lame --preset "$item" `echo "$item" | sed 's/.mp3/.wav/g'`;done

will that work?

or maybe:

find -name "*.mp3" | while read item; do lame --preset extreme "$item" `echo "$item" | sed 's/.mp3/.wav/g'`;done

depending on the parameters of the lame command

[ January 28, 2003: Message edited by: Stryker ]

voidmain:

quote:Originally posted by Agent007:
hi all,

I have about 100 wav files in a folder....Need to convert them to mp3. I'm using lame to do the conversion.

The systax used is:-

#lame   --preset extreme artist.wav artist.mp3

After each song is over, I have to keep changing the song names. Is it possible to make lame automatically goto the next wav file and select the same name for the mp3 file? until all the wav files are over?

thanks,
007
--- End quote ---


How about:

$ for i in *.wav; do lame --preset $i ${i%%.wav}.mp3; done

Stryker:

quote:Originally posted by void main:


How about:

$ for i in *.wav; do lame --preset $i ${i%%.wav}.mp3; done
--- End quote ---


make me look stupid    
i think either one will work, but i am unfamiliar with void main's methods.

Navigation

[0] Message Index

[#] Next page

Go to full version