From 74b0fee0c2c5eabb9529481b41cc6581892119ea Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 2 Sep 2013 10:02:40 -0400 Subject: Add aencode.sh for Opus and AAC. --- aencode.sh | 22 ++++++++++++++++++++++ setup.sh | 1 + 2 files changed, 23 insertions(+) create mode 100755 aencode.sh 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 -- cgit v1.2.3-70-g09d2