Files
ViciDialSVN/agc_2-X/branches/agc_2.0.5/extras/convert_audio.sh
T
mattf 295941e007 Created stable release branch of 2.0.5
git-svn-id: svn://192.168.202.10@1074 3d104415-ff17-0410-8863-d5cf3c621b8a
2009-03-15 13:59:55 +00:00

27 lines
719 B
Bash

#! /bin/bash
cd /var/lib/asterisk/sounds/
if [ -f /var/lib/asterisk/sounds/$1.mp3 ] ; then
sox -w -s $1.mp3 -r 8000 -c 1 $1.wav
sox $1.wav -t gsm -r 8000 -b -c 1 $1.gsm
sox $1.wav -t ul -r 8000 -b -c 1 $1.ul
sox $1.wav -t al -r 8000 -b -c 1 $1.al
else
if [ -f /var/lib/asterisk/sounds/$1.wav ] ; then
cp -f $1.wav ___$1.wav
sox -w -s ___$1.wav -r 8000 -c 1 $1.wav
rm -f ___$1.wav
sox $1.wav -t gsm -r 8000 -b -c 1 $1.gsm
sox $1.wav -t ul -r 8000 -b -c 1 $1.ul
sox $1.wav -t al -r 8000 -b -c 1 $1.al
else
if [ -f /var/lib/asterisk/sounds/$1.gsm ] ; then
sox -w -s $1.gsm -r 8000 -c 1 $1.wav
sox $1.wav -t ul -r 8000 -b -c 1 $1.ul
sox $1.wav -t al -r 8000 -b -c 1 $1.al
fi
fi
fi