[NTLUG:Discuss] Transcoding MP3s

Terry Henderson trryhend at gmail.com
Sat Jul 15 23:12:27 CDT 2006


On 7/15/06, agoats <agoats at compuserve.com> wrote:
> Since you don't seem to be getting any good answers, here's some real
> help:
>
> Using lame:
>
> #!/bin/sh
>
> for i in *.mp3
> do
>     file=${i%.mp3}
>     echo $FILE
>
>     lame -b 128 -cbr ${FILE}.mp3 /user/${FILE}.mp3
> done
>
> for i in *.MP3
> do
>     file=${i%.MP3}
>     echo $FILE
>
>     lame -b 128 -cbr ${FILE}.MP3 /user/${FILE}.mp3
> done
>
>
>
> The above will convert the current directory of mp3's to 128kbps bit
> rate, 44.1kHz sample rate, constant bit rate mp3's in directory  /user.
> The format is repeated for *.MP3 and if you have any Mp3, you need to
> add that section as well.
>
>
> The only problem I have with this is filenames with spaces, those are
> skipped. Anyone know how to correct that?
>

 for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`; done



More information about the Discuss mailing list