[NTLUG:Discuss] Trivial MP3 conversion script

Rick Renshaw bofh69 at yahoo.com
Sun Jun 8 23:29:36 CDT 2008


--- Daniel Hauck <daniel at yacg.com> wrote:

> I did this:
> 
> for i in *.[Ww][Mm][Aa]; do lame $i ; done
> 
> 
> The intent and purpose is to convert all WMA files in a folder over to
> MP3.  It works, but it leaves "wma" in the resulting filename.
> 
> For example, there is a file called "song.wma" and I run lame against
> it, the resulting output file is "song.wma.mp3"
> 
> How can I take the extension off of the file list and then process like
> this?
> 
> ... do lame $i.[Ww][Mm][Aa] $i.mp3; done
> 
> What magic code strips off the ".wma"?

I use:
for i in *.[Ww][Mm][Aa]; do n=`echo $i|sed 's/\.wma//'`;lame $i $n ; done


      



More information about the Discuss mailing list