09/02/18 21:20:08 87OyYhLo
>>18 >>24
どうもです。亀レスついでに勉強中のwav2mp3.shをはっときます。
#!/bin/bash
#this script will convert *.wav to *.mp3
#read path
echo "Enter the directory cd [path] *.wav and [ENTER]:"
read dir
#read VBR or CBR
echo "Enter [v] for VBR or [c] for CBR and [ENTER]:"
read br
#set br
if [ $br = v ]
then
echo "Enter the level[0-9(H-L)] for VBR and [ENTER]:"
read num
br=V
elif [ $br = c ]
then
echo "Enter the bps[32,64,96,128,192,256,320] for CBR and [ENTER]:"
read num
br=b
fi
#cd and mkdir for working and move *wav files and cd working dir
cd "$dir"
#lame:wav to mp3
for file in *.wav
do
/usr/bin/lame -h -$br $num "$file" "${file%wav}mp3"
sleep 6
done
echo "complete!"