2008年4月7日 星期一

Convert WMA to MP3 空中英語教室廣播檔轉成MP3

之前文章

mms downloader(抓取廣播檔)

wma -> wav -> mp3(廣播檔轉成mp3)

現在用成shellscript交給電腦一次處理大約30個左右的檔案

#!/bin/bash
# belong to Nelson Chung' blog
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

count=0
ten=10
for (( i=1; i<=9; i=i+1 ))
do
count=$(($count+1))
echo "Number is "$count""
WMAfilename="2008030""$count""baa.wma"
WAVfilename="2008030""$count""baa.wav"
MP3filename="2008030""$count""baa.mp3"
echo "$WMAfilename"
test -e $WMAfilename && mplayer $WMAfilename -ao pcm:file=$WAVfilename || echo "File Not Exist!!"
test -e $WAVfilename && lame -ms $WAVfilename -o $MP3filename || echo "File Not Exist!!"
done

for (( i=10; i<=31; i=i+1 ))
do
count=$(($count+1))
echo "Number is "$count""
WMAfilename="200803""$count""baa.wma"
WAVfilename="200803""$count""baa.wav"
MP3filename="200803""$count""baa.mp3"
echo "$WMAfilename"
test -e $WMAfilename && mplayer $WMAfilename -ao pcm:file=$WAVfilename || echo "File Not Exist!!"
test -e $WAVfilename && lame -ms $WAVfilename -o $MP3filename || echo "File Not Exist!!"
done
echo "Done!!"

這個shellscript可以把你所先抓下來的廣播檔轉換成mp3
可以把 200803 的部份 轉成 mp3

透過Facebook分享

沒有留言: