this is the virtual fm tuner.
simple shell scripting
but, be connected to the internet
till now, i have just added Nepali FMS.
and, obviously thanks to Satyendra Raj Pandey for this FM idea.
to download the file click here
else, the code is here
#! /bin/sh
commonCommand()
{
common1='[playlist]'
common2='NumberOfEntries=1'
}
quit ()
{
clear
echo "*************************"
printf "SIMPLE FM TUNER V1.0\nDeveloped by\nPUNJ POKHAREL\npunj33@gmail.com\npunj33.blogspot.com\n*************************\n\n"
printf "\nPlease feel free to edit, distribute and contribute. Its totally open source\n\n"
printf "It can be made a whole lot better. So, share your ideas\n\n"
echo "THANK YOU FOR USING SIMPLE FM TUNER V1.0"
printf "\n\n"
echo "Press any Enter to exit"
read nothing
# i tried to kill extracting PID but kill the whole totem seems easy
# a=`ps -ef|grep 'totem fm.log'|grep -v 'grep'`
# b=`echo $a|awk '{print $3}'
# kill -9 totem
if [ $counter -ge 1 ]
then
killall vlc 2> /dev/null
else
killall totem 2> /dev/null
fi
clear
break;
}
choose()
{
case $choice in
1)fm='File1=http://67.202.67.18:8208/;stream.mp3ls';;
2)fm='File1=mms://64.62.166.162/hitsfm';;
3)fm='File1=mms://64.62.166.162/ujyaalofm';;
4)fm='File1=mms://64.62.166.162/sagarmatha_fm' ;;
5)fm='File1=mms://64.62.166.162/nepalfm' ;;
6)fm='File1=mms://64.62.166.162/maitrifm';;
7)quit ;;
esac
}
tune()
{
printf "$common1\n$common2\n$fm" > fm.log
counter=`whatis cvlc|grep 1|wc -l`
if [ $counter -ge 1 ]
then
killall vlc 2> /dev/null &
cvlc fm.log 2> /dev/null &
else
totem fm.log 2> /dev/null &
fi
printf "TUNING "
for i in 1 2 3 4 5
do
printf "."
sleep 0.255
done
echo
}
while [ 0 ]
do
clear
printf "********Welcome to a SIMPLE FM TUNER V1.0*********\n\n"
echo "Please enter your FM station. Press its symbol no. correctly \n"
printf "1. Kantipur FM \n2. Hits FM\n3. Ujjyalo FM\n4. Sagarmatha FM\n5. Nepal FM \n6. Maitri FM\n7. Quit\n\n"
read choice
if [ $choice -ge 8 ]
then
echo "WRONG CHOICE YOU MORON"
echo "Press any key to continue"
read nothing123
else
commonCommand
choose
tune
fi
done
Saturday, November 21, 2009
virtual FM tuner using shell scripting
Posted by Punj Pokharel at 5:58 PM
Labels: linux, shell scripting
Subscribe to:
Post Comments (Atom)
1 comments:
I must say only one word for you....AWESOME!!!!
Post a Comment