[Sussex] MP3 recoding

John Crowhurst fyremoon at fyremoon.net
Tue Aug 2 19:11:10 UTC 2005


On Tue, August 2, 2005 12:47, Dave Chapman said:
>> You could try lame:
>>
>> lame --decode filename.mp3 filename.wav
>> lame -b 64 filename.wav filename-64.mp3
>
> That works.
>> Or for every file in a directory:
>>
>> for i in *.mp3; do
>>   lame --decode $i.mp3 temp.wav
>>   lame -b 64 temp.wav $i-64.mp3
>>   rm -f temp.wav
>> done
>
> This didn't

Doh!

for i in *.mp3; do
  lame --decode $i temp.wav
  lame -b 64 temp.wav $i-64.mp3
  rm -f temp.wav
done

You will end up with some files called filename.mp3-64.mp3, so you can fix
that with rename:

rename .mp3-64.mp3 -64.mp3 *mp3-64.mp3

Which will replace all filenames.mp3-63.mp3 with filenames-64.mp3

--
John




More information about the Sussex mailing list