[gcompris/voices] now the encodeToAAC is named encodeTo and support the target format on the command line



commit 198fba12b9070e890d79287b13e516cb4bbecc04
Author: Bruno Coudoin <bruno coudoin gcompris net>
Date:   Wed Apr 29 00:15:47 2015 +0200

    now the encodeToAAC is named encodeTo and support the target format on the command line
    
    Supported format are aac ac3 mp3

 encodeTo.sh    |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 encodeToAAC.sh |   23 -----------------------
 2 files changed, 46 insertions(+), 23 deletions(-)
---
diff --git a/encodeTo.sh b/encodeTo.sh
new file mode 100755
index 0000000..d6db3f0
--- /dev/null
+++ b/encodeTo.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# First create a new directory (aac ac3 mp3)
+# Example for aac:
+# rsync -a voices.ogg/ voices.aac
+# cd voices.aac
+# ./encodeTo.sh
+
+if [ $# -ne 1 ]
+then
+  echo "Usage $(basename $0) aac|ac3|mp3"
+  exit 1
+fi
+
+format=$1
+
+if [ $format = "aac" ]
+then
+  codec="libvo_aacenc"
+elif [ $format = "ac3" ]
+then
+  codec="ac3"
+elif [ $format = "mp3" ]
+then
+  codec="libmp3lame"
+else
+  echo "Error, unsupported format $1"
+  exit 1
+fi
+
+echo "Transcode ogg files to $format"
+for f in $(find . -type f -name \*.ogg)
+do
+    echo "Processing $f"
+    avconv -v warning -i $f -acodec $codec ${f%.*}.${format}
+    rm -f $f
+done
+
+echo "Fix symlinks"
+for f in $(find . -type l -name \*.ogg)
+do
+    echo "Processing $f"
+    target=$(readlink -f $f)
+    rm $f
+    ln -s -r ${target%.*}.${format} ${f%.*}.${format}
+done


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