Re: Recording in chunks using sox

Jan Stary <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <[email protected]>
On Aug 26 12:42:27, [email protected] wrote:
> @Jan: Well am not getting any attachment in your message.

sorry, attaching now

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
radio (text/plain, 836 B)
#!/bin/sh

fatal() {
	echo $@ >&2
	exit 1
}

[ $# -ge 1 ] || fatal "usage: $0 station [length [outfile]]"

STATION=${1}
SECONDS=${2}
OUTFILE=${3}

CONFIG="$HOME/.radiorc"
. $CONFIG || fatal "Config file $CONFIG not found, no stations defined"
grep "^$STATION=" $CONFIG > /dev/null || fatal "Station '$STATION' not defined"
eval URL=\$$STATION

[ -z "$OUTFILE" ] && OUTFILE="$STATION-`date +%Y%m%d%H%M%S`.${URL##*.}"
[ -e "$OUTFILE" ] && fatal "$OUTFILE already exists"

if [ $# -eq 1 ] ; then
	play=`which play` || fatal "play(1) not found"
	$play $URL
else
	ftp -g -p -V -o $OUTFILE $URL >/dev/null 2>&1 &
	PID=$! && [ "$PID" ] && ps -p $PID >/dev/null 2>&1 ||
		fatal "Error downloading $URL"
	sleep $SECONDS && ps -p $PID >/dev/null 2>&1 ||
		fatal "Process $PID downloading $OUTFILE already exited"
	kill -9 $PID >/dev/null 2>&1
fi
.radiorc (text/plain, 433 B)
# Stations recognized by radio(1). This config file is
# sourced directly, so keep it in valid sh(1) syntax.

praha="http://icecast6.play.cz/cro2-128.mp3"
vltava="http://icecast5.play.cz/cro3-128.mp3"
wave="http://icecast5.play.cz/crowave-128.mp3"
ddur="http://icecast5.play.cz/croddur-128.mp3"
jazz="http://icecast1.play.cz/crojazz128.mp3"
radio1="http://icecast1.play.cz/radio1.mp3"
slow="http://icecast1.play.cz/slowradio160.mp3"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.