LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-11-2008, 05:45 PM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
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 ?
 
Old 05-12-2008, 05:53 AM   #2
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM
setup lirc to command tvtime and mplayer mariogarcia Linux - Software 0 05-28-2007 06:46 AM
Know of a command executing program for LIRC? Titan2k Linux - Software 2 04-07-2007 08:11 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
How do you bind shutdown command to lirc remote cmisip Linux - General 2 01-06-2003 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration