diff --git a/neotools/autoextract.c b/neotools/autoextract.c index 7d59615..f8a104a 100644 --- a/neotools/autoextract.c +++ b/neotools/autoextract.c @@ -12,6 +12,14 @@ int main(int argc, char** argv) if (!file) return 1; + if (fgetc(file) == 0x1F && fgetc(file) == 0x8B) + { + printf("I'm a little gzip short and stout\n"); + return 2; + } + + fseek(file, 0, SEEK_SET); + int err = vgmExtractSamples(file); fclose(file); return err; diff --git a/neotools/autoextract.sh b/neotools/autoextract.sh index c82b84a..7d2db7b 100755 --- a/neotools/autoextract.sh +++ b/neotools/autoextract.sh @@ -5,16 +5,8 @@ FILE="$1" NAME="$(basename "$FILE")" WAVDIR="${NAME%%.*}" -if [ "${NAME##*.}" = "vgz" ]; then - cp "$FILE" "temp.vgm.gz" - gzip -fd "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"