[asterisk-commits] kmoore: trunk r326368 - /trunk/contrib/scripts/file.convert.sh
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 5 15:25:26 CDT 2011
Author: kmoore
Date: Tue Jul 5 15:25:23 2011
New Revision: 326368
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=326368
Log:
Prompt conversion script
Several variables in the script control which files are converted and the
source and destination formats.
Patch-by: Trey Blancher <support at digium.com>
(closes AST-601)
Added:
trunk/contrib/scripts/file.convert.sh (with props)
Added: trunk/contrib/scripts/file.convert.sh
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/scripts/file.convert.sh?view=auto&rev=326368
==============================================================================
--- trunk/contrib/scripts/file.convert.sh (added)
+++ trunk/contrib/scripts/file.convert.sh Tue Jul 5 15:25:23 2011
@@ -1,0 +1,20 @@
+#/bin/bash
+
+# Script written by Trey Blancher (support at 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
Propchange: trunk/contrib/scripts/file.convert.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/contrib/scripts/file.convert.sh
------------------------------------------------------------------------------
svn:executable = *
Propchange: trunk/contrib/scripts/file.convert.sh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: trunk/contrib/scripts/file.convert.sh
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list