diff options
author | Kinsey Moore <kmoore@digium.com> | 2011-07-05 20:25:23 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2011-07-05 20:25:23 +0000 |
commit | 84686384fcabb14775d7650472c0297b9b071e3d (patch) | |
tree | 203cd61da37a16b3a52fde2cc50acc2c2ad8e450 /contrib | |
parent | 14d510c5b7a07cefdd617f276da5617e197c9f05 (diff) |
Prompt conversion script
Several variables in the script control which files are converted and the
source and destination formats.
Patch-by: Trey Blancher <support@digium.com>
(closes AST-560)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/file.convert.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/scripts/file.convert.sh b/contrib/scripts/file.convert.sh new file mode 100755 index 000000000..9fc2e66eb --- /dev/null +++ b/contrib/scripts/file.convert.sh @@ -0,0 +1,20 @@ +#/bin/bash + +# Script written by Trey Blancher (support@digium.com) + +# This script is designed to convert all files of type $SRC to +# the $DST format, for the given $LANGUAGE. It traverses the given +# language directory (by default in /var/lib/asterisk/sounds/), and +# converts each file with filename extension $SRC, and converts them +# using Asterisk to files with type and extension $DST. + +LANGUAGE=en # change accordingly, if converting custom sounds you may want to omit this variable +SRC=gsm # change accordingly (e.g. to wav, etc.) +DST=g729 # change accordingly (e.g. to wav, etc.) +SOUNDS=/var/lib/asterisk/sounds # for custom sounds change this directory to your custom sound directory + +for file in $(find ${SOUNDS}/${LANGUAGE}/ -depth -type f -name *.${SRC}); +do + #echo $file + asterisk -rx "file convert $file $(dirname $file)/$(basename $file $SRC)$DST" +done |