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

Re: [listener] Changing listener file type



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
 
 
----- Original Message -----
Sent: Thursday, February 17, 2005 10:10 AM
Subject: [listener] Changing listener file type

I'm using listener 9.0, it works perfectly congratulations!
   Now I'm trying to create a script that would run inside listener source to
change the wav files to speex files. I would appreciate If you show me what
part of the source would be better to insert this script. Thanks for the
attention.

------------------------------------------------------------------------------------
This message was sent through the Listener mailinglist (www.vanheusden.com/listener)



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 2/14/2005

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