<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Record Streaming Audio with Linux: Part II</title>
	<atom:link href="http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/feed/" rel="self" type="application/rss+xml" />
	<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/</link>
	<description>by Shawn Dowler</description>
	<lastBuildDate>Tue, 22 Dec 2009 19:18:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Shawn Dowler</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-36</link>
		<dc:creator>Shawn Dowler</dc:creator>
		<pubDate>Sat, 09 Aug 2008 00:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-36</guid>
		<description>Quite honestly, I don&#039;t know how you would accomplish pausing the recording. It&#039;s streaming live, so you certainly can&#039;t stop that part, but it may be possible to divert the stream through the fifos to &lt;code&gt;/dev/null&lt;/code&gt; when a button is pressed and go back again afterward.

I honestly don&#039;t have the &quot;code fu&quot; to do anything like that or to answer your question without a lot of fiddling and researching.  I&#039;m glad that you find the code useful, and I do appreciate your posting here with updates when you make interesting modifications.</description>
		<content:encoded><![CDATA[<p>Quite honestly, I don&#8217;t know how you would accomplish pausing the recording. It&#8217;s streaming live, so you certainly can&#8217;t stop that part, but it may be possible to divert the stream through the fifos to <code>/dev/null</code> when a button is pressed and go back again afterward.</p>
<p>I honestly don&#8217;t have the &#8220;code fu&#8221; to do anything like that or to answer your question without a lot of fiddling and researching.  I&#8217;m glad that you find the code useful, and I do appreciate your posting here with updates when you make interesting modifications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xwang</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-35</link>
		<dc:creator>Xwang</dc:creator>
		<pubDate>Fri, 08 Aug 2008 14:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-35</guid>
		<description>Hi,
I&#039;ve done the following script which acts as a &quot;wizard&quot; with some pop up that enables the user to pass the input to the recorder.
Do you like it?
Do you think is it possible to modify it in order to pause the recording?
Thank you,
Xwang
[bash]
#!/bin/bash
# radioRecoder.sh
# v0.2.0 - 20080808 :-)
# Xwang
# Released under GPL 2.0 and following (can you help me and tell if it is GPL3 compliant?)

# This script acts as a wizard enabling the user to select the URL to listen and eventually rip it after having specified
# the directory and the file name
# The cancel button is used to go to the previous page
# To exit the program press cancel in the URL page and follow the instruction


# TBD
# check if parameter is passed or not
# modify parmeters so that recording can be done without user iteration
# capture Ctrl-C in order to clean all temporary files and kill opened processes before closing
# put confirmation on registration stop
# open the directory where last file has been saved (maybe asking for it) at the end of the recording
# translate messanges
#



# assign as default stream value the one passed ad first parameters if any (check TBD)
STREAM=$1

TEMPDIR=/tmp
# inizialize variables
EXIT=1
STATE=1
PIDlistener2=&quot;&quot;
PIDrecorder2=&quot;&quot;

while [ $EXIT -eq 1 ]
do
	case $STATE in
	0)
		kdialog --title &quot;RadioRecorder&quot; --yesno &quot;Do you want to exit the program?&quot;
		EXIT=$?
		if [ $EXIT -eq 1 ]
		then
			STATE=1
		fi
	;;
	1)
	# ask radio stream URL
		STREAM=`kdialog --title &quot;RadioRecorder&quot; --inputbox &quot;Insert the radio stream url&quot; $1 `
		STREAMBUTTON=$?
		if [ $STREAMBUTTON -eq 1 ]
		then
			STATE=0
		else
			# start mplayer in background to listen to the radio only if the ok button has been selected else exit
#			xterm -e mplayer -vo null -vc null -cache 512 $STREAM&#38;
			mplayer -vo null -vc null -cache 512 $STREAM&#38;
			PIDlistener=$! # listener PID
			while [ -z $PIDlistener2 ]
			do
				#repeat the check till PIDlistener2 is correctly detected
				PIDlistener2=`ps -ef&#124; awk &#039;$3 == &#039;$PIDlistener&#039; { print $2 }&#039;`
			done
			STATE=2
		fi
	;;
	2)
	# select action to do
		ACTION=`kdialog --title &quot;RadioRecorder&quot; --menu &quot;Select an action:&quot; 1 &quot;Change URL&quot; 2 &quot;Record stream&quot;`
		ACTIONBUTTON=$?

		if [ $ACTIONBUTTON -eq 1 ]
		then
			ACTION=$ACTIONBUTTON # if cancel is selected go back to url dialog
		fi
		if [ $ACTION -eq 1 ]
		then
			#if Change URL or Cancel has been selected kill listener and go back to URL page
			#kill listener processes
			kill -9 $PIDlistener2
			kill -9 $PIDlistener
			# reinitialize PID variables
			PIDlistener=&quot;&quot;
			PIDlistener2=&quot;&quot;
			STATE=1
		else
			STATE=3
		fi
	;;
	3)
	# ask destination directory -- default home

		DIR=$HOME
		DIR=`kdialog --title &quot;RadioRecorder - Select destination directory&quot; --getexistingdirectory $DIR` #default destination directory is the user home
		DIRBUTTON=$?
		if [ $DIRBUTTON -eq 1 ]
		then
			#if Cancel has been selected go back to action page
			STATE=2
		else
			STATE=4
		fi
	;;
	4)
	# ask file name at which will be added the date and eventually record stream
		FILENAME=&quot;radio&quot;
		FILENAME=`kdialog --title &quot;RadioRecorder - Save as&quot; --inputbox &quot;Insert the file name (date will be automatically added)&quot; $FILENAME`
		FILENAMEBUTTON=$?
		if [ $FILENAMEBUTTON -eq 1 ]
		then
			#if Cancel has been selected go back to action page
			STATE=3
		else
			#capture stream
			DATE=`date +%Y_%m_%d_%H%M%S`
			TEMPFILE=$TEMPDIR/$FILENAME-$DATE
			FILE=$DIR/$FILENAME-$DATE
			mkfifo $TEMPFILE.wav
			lame $TEMPFILE.wav $FILE.mp3&gt;/dev/null&#38;
			PIDconverter=$! #converter PIN
# 			xterm -e mplayer -cache 512 -vo null -vc null -ao pcm:fast:file=&quot;$TEMPFILE.wav&quot; $STREAM&gt;/dev/null&#38;
			mplayer -cache 512 -vo null -vc null -ao pcm:fast:file=&quot;$TEMPFILE.wav&quot; $STREAM&gt;/dev/null&#38;
			PIDrecorder=$! #recorder PIN
			while [ -z $PIDrecorder2 ]
			do
				#repeat the check till PIDrecorder2 is correctly detected
				PIDrecorder2=`ps -ef&#124; awk &#039;$3 == &#039;$PIDrecorder&#039; { print $2 }&#039;`
			done
			kdialog --msgbox &quot;Press OK button to stop recording&quot;
			#stop recording
			#kill converter

			kill -9 $PIDconverter
			#kill recorder processes
			kill -9 $PIDrecorder2
			kill -9 $PIDrecorder
			# reinitialize PID variables
			PIDconverter=&quot;&quot;
			PIDrecorder=&quot;&quot;
			PIDrecorder2=&quot;&quot;
			#removing temporary file
			rm $TEMPFILE.wav
			#go back to action page
			STATE=2
		fi
	;;
	esac
done

kdialog --title &quot;RadioRecorder&quot; --msgbox &quot;Thank you for using radioRecorder&quot;
echo &quot;Bye Bye&quot;
exit
[/bash]</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I've done the following script which acts as a "wizard" with some pop up that enables the user to pass the input to the recorder.<br />
Do you like it?<br />
Do you think is it possible to modify it in order to pause the recording?<br />
Thank you,<br />
Xwang</p>
<div class="igBar"><span id="lbash-1"><a href="#" onclick="javascript:showCodeTxt('bash-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-1">
<div class="bash">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#!/bin/bash</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># radioRecoder.sh</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># v0.2.0 - 20080808 :-)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># Xwang</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># Released under GPL 2.0 and following (can you help me and tell if it is GPL3 compliant?)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># This script acts as a wizard enabling the user to select the URL to listen and eventually rip it after having specified</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># the directory and the file name</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># The cancel button is used to go to the previous page</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># To exit the program press cancel in the URL page and follow the instruction</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># TBD</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># check if parameter is passed or not</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># modify parmeters so that recording can be done without user iteration</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># capture Ctrl-C in order to clean all temporary files and kill opened processes before closing</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># put confirmation on registration stop</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># open the directory where last file has been saved (maybe asking for it) at the end of the recording</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># translate messanges</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># assign as default stream value the one passed ad first parameters if any (check TBD)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">STREAM=</span>$<span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">TEMPDIR=</span>/tmp</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># inizialize variables</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">EXIT=</span><span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">PIDlistener2=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">PIDrecorder2=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$EXIT</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">do</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">$STATE</span> <span style="color: #b1b100;">in</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; kdialog --title <span style="color: #ff0000;">"RadioRecorder"</span> --yesno <span style="color: #ff0000;">"Do you want to exit the program?"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">EXIT=</span>$?</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$EXIT</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ;;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># ask radio stream URL</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STREAM=</span>`kdialog --title <span style="color: #ff0000;">"RadioRecorder"</span> --inputbox <span style="color: #ff0000;">"Insert the radio stream url"</span> $<span style="color: #cc66cc;color:#800000;">1</span> `</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STREAMBUTTON=</span>$?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$STREAMBUTTON</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># start mplayer in background to listen to the radio only if the ok button has been selected else exit</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">#&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;xterm -e mplayer -vo null -vc null -cache 512 $STREAM&amp;#38;#38;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mplayer -vo null -vc null -cache <span style="color: #cc66cc;color:#800000;">512</span> <span style="color: #0000ff;">$STREAM</span>&amp;<span style="color: #808080; font-style: italic;">#38;#38;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDlistener=</span>$! <span style="color: #808080; font-style: italic;"># listener PID</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#91;</span> -z <span style="color: #0000ff;">$PIDlistener2</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#repeat the check till PIDlistener2 is correctly detected</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDlistener2=</span>`ps -ef| awk <span style="color: #ff0000;">'$3 == '</span><span style="color: #0000ff;">$PIDlistener</span><span style="color: #ff0000;">' { print $2 }'</span>`</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">done</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ;;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># select action to do</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION=</span>`kdialog --title <span style="color: #ff0000;">"RadioRecorder"</span> --menu <span style="color: #ff0000;">"Select an action:"</span> <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #ff0000;">"Change URL"</span> <span style="color: #cc66cc;color:#800000;">2</span> <span style="color: #ff0000;">"Record stream"</span>`</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIONBUTTON=</span>$?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$ACTIONBUTTON</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION=</span><span style="color: #0000ff;">$ACTIONBUTTON</span> <span style="color: #808080; font-style: italic;"># if cancel is selected go back to url dialog</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$ACTION</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#if Change URL or Cancel has been selected kill listener and go back to URL page</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#kill listener processes</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">kill</span> -<span style="color: #cc66cc;color:#800000;">9</span> <span style="color: #0000ff;">$PIDlistener2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">kill</span> -<span style="color: #cc66cc;color:#800000;">9</span> <span style="color: #0000ff;">$PIDlistener</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># reinitialize PID variables</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDlistener=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDlistener2=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">3</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ;;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># ask destination directory -- default home</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DIR=</span><span style="color: #0000ff;">$HOME</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DIR=</span>`kdialog --title <span style="color: #ff0000;">"RadioRecorder - Select destination directory"</span> --getexistingdirectory <span style="color: #0000ff;">$DIR</span>` <span style="color: #808080; font-style: italic;">#default destination directory is the user home</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DIRBUTTON=</span>$?</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$DIRBUTTON</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#if Cancel has been selected go back to action page</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">4</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ;;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #cc66cc;color:#800000;">4</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># ask file name at which will be added the date and eventually record stream</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FILENAME=</span><span style="color: #ff0000;">"radio"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FILENAME=</span>`kdialog --title <span style="color: #ff0000;">"RadioRecorder - Save as"</span> --inputbox <span style="color: #ff0000;">"Insert the file name (date will be automatically added)"</span> <span style="color: #0000ff;">$FILENAME</span>`</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FILENAMEBUTTON=</span>$?</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #0000ff;">$FILENAMEBUTTON</span> -eq <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#if Cancel has been selected go back to action page</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#capture stream</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DATE=</span>`date +%Y_%m_%d_%H%M%S`</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TEMPFILE=</span><span style="color: #0000ff;">$TEMPDIR</span>/<span style="color: #0000ff;">$FILENAME</span>-<span style="color: #0000ff;">$DATE</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FILE=</span><span style="color: #0000ff;">$DIR</span>/<span style="color: #0000ff;">$FILENAME</span>-<span style="color: #0000ff;">$DATE</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkfifo <span style="color: #0000ff;">$TEMPFILE</span>.wav</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lame <span style="color: #0000ff;">$TEMPFILE</span>.wav <span style="color: #0000ff;">$FILE</span>.mp3&amp;<span style="color: #808080; font-style: italic;">#38;gt;/dev/null&amp;#38;#38;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDconverter=</span>$! <span style="color: #808080; font-style: italic;">#converter PIN</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"># &nbsp; &nbsp; &nbsp; xterm -e mplayer -cache 512 -vo null -vc null -ao pcm:fast:file=&quot;$TEMPFILE.wav&quot; $STREAM&amp;#38;gt;/dev/null&amp;#38;#38;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mplayer -cache <span style="color: #cc66cc;color:#800000;">512</span> -vo null -vc null -ao pcm:fast:<span style="color: #0000ff;">file=</span><span style="color: #ff0000;">"$TEMPFILE.wav"</span> <span style="color: #0000ff;">$STREAM</span>&amp;<span style="color: #808080; font-style: italic;">#38;gt;/dev/null&amp;#38;#38;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDrecorder=</span>$! <span style="color: #808080; font-style: italic;">#recorder PIN</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#91;</span> -z <span style="color: #0000ff;">$PIDrecorder2</span> <span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#repeat the check till PIDrecorder2 is correctly detected</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDrecorder2=</span>`ps -ef| awk <span style="color: #ff0000;">'$3 == '</span><span style="color: #0000ff;">$PIDrecorder</span><span style="color: #ff0000;">' { print $2 }'</span>`</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">done</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kdialog --msgbox <span style="color: #ff0000;">"Press OK button to stop recording"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#stop recording</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#kill converter</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">kill</span> -<span style="color: #cc66cc;color:#800000;">9</span> <span style="color: #0000ff;">$PIDconverter</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#kill recorder processes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">kill</span> -<span style="color: #cc66cc;color:#800000;">9</span> <span style="color: #0000ff;">$PIDrecorder2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">kill</span> -<span style="color: #cc66cc;color:#800000;">9</span> <span style="color: #0000ff;">$PIDrecorder</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># reinitialize PID variables</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDconverter=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDrecorder=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PIDrecorder2=</span><span style="color: #ff0000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#removing temporary file</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rm <span style="color: #0000ff;">$TEMPFILE</span>.wav</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">#go back to action page</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">STATE=</span><span style="color: #cc66cc;color:#800000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">fi</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ;;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">esac</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">done</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">kdialog --title <span style="color: #ff0000;">"RadioRecorder"</span> --msgbox <span style="color: #ff0000;">"Thank you for using radioRecorder"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">echo</span> <span style="color: #ff0000;">"Bye Bye"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">exit</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xwang</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-34</link>
		<dc:creator>Xwang</dc:creator>
		<pubDate>Wed, 06 Aug 2008 08:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-34</guid>
		<description>Hi,
how can I add a simple frontend which permits to insert:
1) the location where to save the stream
2) the url
2) the recording time
Moreover I would like to be able to start and stop the recording using a record and a stop button.
I&#039;ve done in the past a simple gui using perl, but I don&#039;t know how to modify the script in order to stop the registration using the gui</description>
		<content:encoded><![CDATA[<p>Hi,<br />
how can I add a simple frontend which permits to insert:<br />
1) the location where to save the stream<br />
2) the url<br />
2) the recording time<br />
Moreover I would like to be able to start and stop the recording using a record and a stop button.<br />
I've done in the past a simple gui using perl, but I don't know how to modify the script in order to stop the registration using the gui</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn Dowler</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-32</link>
		<dc:creator>Shawn Dowler</dc:creator>
		<pubDate>Mon, 19 Mar 2007 22:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-32</guid>
		<description>@mxwlpxwl:
The sox command was a late addition as I noticed some of the stations were including long periods of silence in place of certain commercials.  It doesn&#039;t happen as much anymore, but it still happens every now and again.  The sox command just strips out silence, nothing more.  You could leave it out, but it doesn&#039;t change much if you leave it in, so I just put it in for all of them.

I&#039;m glad you like the scripts.  Remember, I didn&#039;t come up with the concept, I just improved upon the original design.</description>
		<content:encoded><![CDATA[<p>@mxwlpxwl:<br />
The sox command was a late addition as I noticed some of the stations were including long periods of silence in place of certain commercials.  It doesn't happen as much anymore, but it still happens every now and again.  The sox command just strips out silence, nothing more.  You could leave it out, but it doesn't change much if you leave it in, so I just put it in for all of them.</p>
<p>I'm glad you like the scripts.  Remember, I didn't come up with the concept, I just improved upon the original design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mxwlpxwl</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-33</link>
		<dc:creator>mxwlpxwl</dc:creator>
		<pubDate>Sun, 18 Mar 2007 22:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-33</guid>
		<description>Your script is great, I&#039;m trying to implement now, but I have a question as to why you are running lame, then sox, and finally mplayer. I&#039;m sure this is correct, I am just wondering why?

Again, your script is tight, good work :-)


mxwlpxwl</description>
		<content:encoded><![CDATA[<p>Your script is great, I'm trying to implement now, but I have a question as to why you are running lame, then sox, and finally mplayer. I'm sure this is correct, I am just wondering why?</p>
<p>Again, your script is tight, good work :-)</p>
<p>mxwlpxwl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn Dowler</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-31</link>
		<dc:creator>Shawn Dowler</dc:creator>
		<pubDate>Sun, 04 Feb 2007 06:24:01 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-31</guid>
		<description>@Michael Brehm:
I&#039;m glad that I could help you find a way to solve your problems using Free Software.  I love to hear stories like yours, and the thanks are always appreciated!</description>
		<content:encoded><![CDATA[<p>@Michael Brehm:<br />
I'm glad that I could help you find a way to solve your problems using Free Software.  I love to hear stories like yours, and the thanks are always appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Brehm</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-30</link>
		<dc:creator>Michael Brehm</dc:creator>
		<pubDate>Sat, 03 Feb 2007 16:51:51 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-30</guid>
		<description>Thanks for this solution the scheduling of online programs was one of the items causing me to dual boot. Now I have one less reason to keep my XP partition. I just wish that it did not take me 5 days to find this solution after I started looking for it on the net! Again THANK YOU and also to all the authors of the pages that were referenced.

The only problem I am having getting this to work in Ubuntu is with RECORD_HI, but RECORD works great. I will figure that our soon enough, but this was a great start.</description>
		<content:encoded><![CDATA[<p>Thanks for this solution the scheduling of online programs was one of the items causing me to dual boot. Now I have one less reason to keep my XP partition. I just wish that it did not take me 5 days to find this solution after I started looking for it on the net! Again THANK YOU and also to all the authors of the pages that were referenced.</p>
<p>The only problem I am having getting this to work in Ubuntu is with RECORD_HI, but RECORD works great. I will figure that our soon enough, but this was a great start.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jmfv</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-29</link>
		<dc:creator>jmfv</dc:creator>
		<pubDate>Wed, 10 May 2006 13:37:59 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-29</guid>
		<description>Beautiful! Easy to understand the code, easy to implement, very useful results. Just what every Linux user dreams of. Thank you and congrats!</description>
		<content:encoded><![CDATA[<p>Beautiful! Easy to understand the code, easy to implement, very useful results. Just what every Linux user dreams of. Thank you and congrats!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn Dowler</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-28</link>
		<dc:creator>Shawn Dowler</dc:creator>
		<pubDate>Fri, 03 Mar 2006 19:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-28</guid>
		<description>I was working on my own solution, but I knew it was lacking some things, so when I found your implementation I was very impressed.  I especially liked the way you killed all the processes.  That was what I was looking for when I found your scripts.  Your scripts were great, so I merged what I had with what you had done and I&#039;m very pleased with the results.

I especially like your today script.  It is so much nicer than what I was doing before.  Now I have a central human-readable place to keep all the program scheduling data outside of my crontab.</description>
		<content:encoded><![CDATA[<p>I was working on my own solution, but I knew it was lacking some things, so when I found your implementation I was very impressed.  I especially liked the way you killed all the processes.  That was what I was looking for when I found your scripts.  Your scripts were great, so I merged what I had with what you had done and I'm very pleased with the results.</p>
<p>I especially like your today script.  It is so much nicer than what I was doing before.  Now I have a central human-readable place to keep all the program scheduling data outside of my crontab.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dannyman.toldme.com / HOWTO: Archive Audio Streams in to mp3 Files</title>
		<link>http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/comment-page-1/#comment-27</link>
		<dc:creator>dannyman.toldme.com / HOWTO: Archive Audio Streams in to mp3 Files</dc:creator>
		<pubDate>Fri, 03 Mar 2006 19:10:49 +0000</pubDate>
		<guid isPermaLink="false">http://walkingtowel.org/2006/03/03/record-streaming-audio-with-linux-part-ii/#comment-27</guid>
		<description>[...] check out the comments that follow for tips and tricks, especially Shawn Dowler who has gone and wrote a page about his revised versions of thescripts. [...]</description>
		<content:encoded><![CDATA[<p>[...] check out the comments that follow for tips and tricks, especially Shawn Dowler who has gone and wrote a page about his revised versions of thescripts. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 1.728 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-02-10 11:08:25 -->
<!-- Compression = gzip -->