[asterisk-users] [1.4 + FreeBSD 6.2] Playing WAV PCM file?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Jan 1 11:42:35 CST 2008


On Tue, Jan 01, 2008 at 11:27:54AM -0500, dave cantera wrote:
> vincent,
> here is a script that I used to convert a single wav file or the entire
> directory... no file specified on launch, converts all files in the current
> directory...
> creates a logfile, although trivial...
> daveC
> 
> #!/bin/sh
> #
> #    convert-all.sh
> #
> #    convert all *.wav files to .gsm .au formats
> #
> 
> if [ "null${1}" == "null" ]
> then
>     FILE_LIST=`ls *.wav`
> else
>     FILE_LIST=`ls ${1}*.wav`
> fi
> 
> LOG="./log_convert.log"
> echo "======================================================= " >>${LOG}
> echo "        started at `date`         " >>${LOG}
> 
> echo " Removing all current .gsm files..."
> rm -f *.gsm
> 

# A note from the Useless Use of ls Committee:

for FNAME in $1*.wav

> for FNAME in ${FILE_LIST}
> do
>     echo "----   -------   ----- "
>     echo "----   " >>${LOG}
>     echo " Processing ${FNAME}... "
>     echo " Processing ${FNAME}... " >>${LOG}
>     BASEFNAME=`echo ${FNAME} | awk '{print substr($0,1,length($0)-4)}'`
> 
>     echo "         making ${BASEFNAME}.gsm... "
>     echo "         making ${BASEFNAME}.gsm... " >>${LOG}
>     #sox -q -V -c 1  ${FNAME} -r 8000 -c 1 -w ${BASEFNAME}.gsm resample -ql 
> 2>>${LOG}
>     sox -q -V ${FNAME} -r 8000 -c 1 ${BASEFNAME}.gsm resample -ql  2>>${LOG}
>     echo "----   " >>${LOG}
>     echo "         making ${BASEFNAME}.au... "
>     echo "         making ${BASEFNAME}.au... " >>${LOG}
>     sox -q -V ${FNAME} -t au -r 8000 -c 1 -w ${BASEFNAME}.au resample -ql 2>>$
> {LOG}
> done

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list