1
0
mirror of https://github.com/ScrelliCopter/VGM-Tools synced 2025-02-21 04:09:25 +11:00

port autoextract to shell

This commit is contained in:
2019-09-27 15:58:08 +10:00
parent 7c5a577fba
commit 6164533c1a

19
neotools/autoextract.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
FILE="$1"
NAME="$(basename "$FILE")"
WAVDIR="${NAME%%.*}"
if [ "${NAME##*.}" = "vgz" ]; then
cp "$FILE" "temp.vgm.gz"
gzip -d "temp.vgm.gz"
FILE="temp.vgm"
fi
./neoadpcmextract "$FILE"
mkdir -p "$WAVDIR"
for I in smpa_*.pcm; do ./adpcm "$I" "$WAVDIR/${I%%.*}.wav"; done
for I in smpb_*.pcm; do ./adpcmb -d "$I" "$WAVDIR/${I%%.*}.wav"; done
find . -type f -name "*.pcm" -exec rm -f {} \;
[ "$FILE" = "temp.vgm" ] && rm -f "temp.vgm"