script to take streaming audio and convert to mp3

linux@linux-laptop:/media/F8D86D5BD86D1960/tmp$ cat pullandconvert.sh 
#!/bin/sh


a=$(date +%d_%m_%Y_%k_%M)
#use mimms to pull the stream for 53 minutes and output to asf file
#mimms -t 53 -o "/MediaH2/StreamCapture/$a.asf" mms://84.40.18.197/foxpull3
path=/media/F8D86D5BD86D1960/tmp
mplayer $1 -dumpstream -dumpfile $path/$a.asf

#convert asf to wav
mplayer -novideo -ao "pcm:file=$path/$a.wav" "$path/$a.asf" 
#rm "$path/$a.asf"
#convert wav to mp3
lame -m s -a -b 24 "$path/$a.wav" "$path/$a.mp3"
#rm "/MediaH2/StreamCapture/$a.wav"

Comments