[gcompris/voices] add support of aac/ogg generation



commit 0cbc765b2a7e71a92389ac40cf9fae77301e86f9
Author: Bruno Coudoin <bruno coudoin gcompris net>
Date:   Tue Apr 28 23:27:35 2015 +0200

    add support of aac/ogg generation

 generate_voices_rcc.sh |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/generate_voices_rcc.sh b/generate_voices_rcc.sh
index c77921f..ffee9c0 100755
--- a/generate_voices_rcc.sh
+++ b/generate_voices_rcc.sh
@@ -8,12 +8,19 @@
 #
 # Usage:
 # cd git/GCompris-voices/
-# generate_voices_rcc.sh
+# generate_voices_rcc.sh ogg|aac <path to gtk lang words dir>
 #
 # Results will be written to $PWD/.rcc/ which is supposed be synced to the
 # upstream location.
 #
 
+[ $# -ne 2 ] && {
+    echo "Usage: generate_voices_rcc.sh ogg|aac <path to gtk lang words dir>"
+    exit 1
+}
+# Compressed Audio Format
+CA=$1
+
 QRC_DIR="."
 RCC_DIR=".rcc"
 #RCC_DEFAULT=`which rcc 2>/dev/null`   # default, better take /usr/bin/rcc?
@@ -29,11 +36,7 @@ MD5SUM=/usr/bin/md5sum
     exit 1
 }
 
-[ $# -ne 1 ] && {
-    echo "Usage: generate_voices_rcc.sh <path to gtk lang words dir>"
-    exit 1
-}
-WORDS_DIR=$1
+WORDS_DIR=$2
 [ ! -d "${WORDS_DIR}" ] && {
     echo "Words dir ${WORDS_DIR} not found"
     exit 1
@@ -75,12 +78,12 @@ echo "Generating binary resource files in ${RCC_DIR}/ folder:"
 mkdir  ${RCC_DIR}
 
 #header of the global qrc (all the langs)
-QRC_FULL_FILE="${QRC_DIR}/full.qrc"
-RCC_FULL_FILE="${RCC_DIR}/full.rcc"
+QRC_FULL_FILE="${QRC_DIR}/full-${CA}.qrc"
+RCC_FULL_FILE="${RCC_DIR}/full-${CA}.rcc"
 header_rcc $QRC_FULL_FILE
 
 # Create the voices directory that will contains links to locales dir
-VOICE_DIR='voices-ogg'
+VOICE_DIR="voices-${CA}"
 [ -d ${RCC_DIR} ] && rm -rf ${RCC_DIR}
 rm -rf ${VOICE_DIR}
 mkdir -p ${VOICE_DIR}
@@ -96,8 +99,7 @@ for LANG in `find . -maxdepth 1 -regextype posix-egrep -type d -regex "\./[a-z]{
     echo -n "  ${LANG#./}: ${QRC_FILE} ... "
     # check for junk in the voices dirs:
     if [ ! -z "`git status --porcelain ${LANG} | grep '^??'`" ]; then
-        echo "Found untracked files in your git checkout below ${LANG}. Better "git clean -f" it first!";
-        exit 1;
+        echo "Warning, found untracked files in your git checkout below ${LANG}. Better "git clean -f" it 
first!";
     fi
     [ -e ${QRC_FILE} ] && rm ${QRC_FILE}
 


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