Home > linux, shell script > wma to mp3 shell script

wma to mp3 shell script

This shell script will convert wma files to variable rate mp3.

#!/bin/sh

find . -name '* *' | sort | while read FILE
do
    NEWFILE=`echo ${FILE} | sed 's/ /_/g;'`
    mv "${FILE}" "${NEWFILE}"
done

for file in *.wma
do
    mplayer $file -ao pcm
    mv audiodump.wav $file.wav
    lame -m s -V 0 $file.wav
    rm $file.wav
    rm $file
done

find . -name '*wma.wav.mp3*' | sort | while read FILE
do
    NEWFILE=`echo ${FILE} | sed 's/wma.wav.mp3/mp3/g;'`
    mv "${FILE}" "${NEWFILE}"
done
Advertisement
Categories: linux, shell script
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.