LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   A command line STREAMTUNER with LIRC (no X) ? (https://www.linuxquestions.org/questions/linux-software-2/a-command-line-streamtuner-with-lirc-no-x-641502/)

frenchn00b 05-11-2008 05:45 PM

A command line STREAMTUNER with LIRC (no X) ?
 
Hello,

I am looking for a program that could work like a multimedia radio. I have an old machine that I installed linux, and with the LIRC I can play radio with it with internet.

Is there a program that would be a command line STREAMTUNER with LIRC (no X) and with selecting would run festival to say what we are about to play from the playlist ?

frenchn00b 05-12-2008 05:53 AM

Ok, I made a script that does the job wiht lircrc :

one has to update the .lircrc with
commands inc or play

Code:

#!/bin/bash

if [ !  -f ~/.festivalrc ] ; then
cat <<\! >~/.festivalrc
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
!
fi

if [ "$1" == "--help" ] ; then
        echo " play, inc, dec, reset, --help  are the possible commands"
        exit 0
fi

if [ "$1" == "reset" ] ; then
        rm ~/.noxstreamtuner
        exit 0
fi


if [ ! -f ~/.noxstreamtuner  ] ; then
        echo "val= 1" > ~/.noxstreamtuner
        echo "max= 5" >> ~/.noxstreamtuner
fi

valuepl="$(cat ~/.noxstreamtuner | grep val | awk '{  print $2 }' )"
maxvaluepl="$(cat ~/.noxstreamtuner | grep max | awk '{  print $2 }'  )"

if [ "$1" == "inc" ]  ; then
        valuepl="$[$valuepl+1]"
fi

if [ "$1" == "dec" ]  ; then
        valuepl="$[$valuepl-1]"
fi

echo "Checker : $[-$valuepl+$maxvaluepl]"
if [ "$[$valuepl-$maxvaluepl]" -gt 0  ] ; then
        valuepl="1"
fi

echo "val= $valuepl"  >  ~/.noxstreamtuner
echo "max= $maxvaluepl"  >>  ~/.noxstreamtuner


echo "$(cat ~/.noxstreamtuner | grep val | awk '{  print $2 }' )  out of $(cat ~/.noxstreamtuner | grep max | awk '{  print $2 }' ) "  | festival --tts 

if [  "$valuepl" == "1" ] ; then
        echo "bbc" | festival --tts
fi

if [  "$valuepl" == "2" ] ; then
        echo "Linux podcasts" | festival --tts
fi

if [  "$valuepl" == "3" ] ; then
        echo "Studio brussels" | festival --tts
fi

if [  "$valuepl" == "4" ] ; then
        echo "France info" | festival --tts
fi

if [  "$valuepl" == "5" ] ; then
        echo "Audacious" | festival --tts
fi



if [ "play" == "$1" ] ; then
        killall -e mplayer totem amule vlc amarok audacious
 
        if [ "$valuepl" == "1" ] ; then
                mplayer -fs http://a352.l2168662744.c21686.n.lm.akamaistream.net/D/352/21686/v0001/reflector:50431 &
        fi

        if [ "$valuepl" == "2" ] ; then
                elinks  http://feeds.feedburner.com/linuxquestions/LQRadioALL  > /tmp/es
                grephttp  /tmp/es | grep mp3 | xargs totem &
        fi

        if [ "$valuepl" == "3" ] ; then
                mplayer http://mp3.streampower.be/stubru-mid.mp3 &
        fi

        if [ "$valuepl" == "4" ] ; then
                mplayer  -af volume=-20 "http://players.creacast.com/creacast/france_info/playlist.m3u"  &
        fi

        if [ "$valuepl" == "5" ] ; then
                audacious &
        fi



fi


cat ~/.noxstreamtuner



All times are GMT -5. The time now is 08:15 AM.