|
You use the "exec = somescriptname" in the
listener.conf file to execute a script to make your conversion.
listener hands the script the fully qualified path
to the output file to be used in the conversion.
I created the following wav2mp3 script to convert
and store the output wav file into an mp3 file.
The wav file is stored temporarily in place
specified in the listener.conf as the "wav_path ="
I create directories for the month and day to store
each file, seperate the file name from the path,
convert the file name from .wav to .mp3,
build the output path and filename, pass the infile and
outfile to lame for conversion to mp3 and then
delete the input .wav file.
>#!/bin/bash
>DEST="/var/recorder/ch1" >DAY=`date +%Y-%b-%d` >MONTH=`date +%Y-%m` >echo "month/day" $MONTH/$DAY > if [ ! -f $DEST/$MONTH ] ; then > mkdir $DEST/$MONTH > /dev/null 2>&1 > fi > if [ ! -f $DEST/$MONTH/$DAY ] ; then > mkdir $DEST/$MONTH/$DAY > /dev/null 2>&1 > fi >INFILE=$1 >echo "infile=" $INFILE >FILENAME=${INFILE: -21} >echo "filename=" $FILENAME >DAYTIME=${FILENAME:0:17} >echo "daytime=" $DAYTIME >MP3FILENAME=${FILENAME/wav/mp3} >echo "mp3filename=" $MP3FILENAME >OUTFILE=$DEST/$MONTH/$DAY/$MP3FILENAME >echo "outfile=" $OUTFILE >lame --quiet --ta "169.590Mhz $DAYTIME" $INFILE $OUTFILE >rm -f $INFILE
|
No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 2/14/2005