[Sussex] MP3 recoding

Steve Dobson steve at dobson.org
Tue Aug 2 20:41:07 UTC 2005


On Tue, Aug 02, 2005 at 08:09:42PM +0100, John Crowhurst wrote:
> 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

Replace the line above
   lame -b 64 temp.wav $i-64.mp3
with
   lame -b 64 temp.wav `basename $i .mp3`-64.mp3
and there will be no need for the rename(1), the script will do 
it itself.

Steve

-- 
philosophy:
	The ability to bear with calmness the misfortunes of our friends.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050802/a63048f6/attachment.pgp 


More information about the Sussex mailing list