Re: Recording in chunks using sox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 26 12:42:27, sox-users@xxxxxxxxxxxxxxxxxxxxx wrote:
> @Jan: Well am not getting any attachment in your message.

sorry, attaching now

#!/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
# 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";
------------------------------------------------------------------------------
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
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux