summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xaencode.sh22
-rwxr-xr-xsetup.sh1
2 files changed, 23 insertions, 0 deletions
diff --git a/aencode.sh b/aencode.sh
new file mode 100755
index 0000000..63ad918
--- /dev/null
+++ b/aencode.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# configure ffmpeg location if not in PATH
+FFMPEG=ffmpeg
+# configure flags
+FFMPEG_FLAGS=""
+
+set -e
+
+aencode() {
+ set -x
+ [[ -f $4 ]] || ${FFMPEG} -threads ${THREADS} -i "$1" -c:a "$2" $3 ${FFMPEG_FLAGS} "$4"
+}
+
+for d in bgm sfx; do
+ cd $(dirname $0)/www/dump/${d}
+ for f in *.ogg; do
+ OUT=${f%.ogg}
+ aencode $f libopus "-b:a 48k -vbr on" ${OUT}.opus
+ aencode $f libfdk_aac -vbr 2 ${OUT}.m4a
+ done
+done
diff --git a/setup.sh b/setup.sh
index bd3afa8..7a09353 100755
--- a/setup.sh
+++ b/setup.sh
@@ -13,3 +13,4 @@ trim www/dump/ui/bt-cf-unchecked.png
trim www/dump/ui/bt-cf-checked.png
./iencode.sh
+./aencode.sh