Fxed yn loop

master
Leo Coogan 4 years ago
parent 259da30d45
commit 8855b05b03

@ -1,7 +1,8 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
# requires: ffmpeg setopt extendedglob
# written by Steve Kinney (2018), licensed under CC BY-SA 4.0 # written by Steve Kinney (2018), licensed under CC BY-SA 4.0
# audio -> 16/48K # audio -> 16/48K (lowers audio quality to 16/48k)
# improvements made by fm'latghor / Leo Coogan <leocoogan@tutanota.com>
IMG_FILES="^*.png ^*.PNG ^*.jpg ^*.JPG ^*.bmp ^*.BMP ^*.gif ^*.GIF ^*.tiff ^*.TIFF" IMG_FILES="^*.png ^*.PNG ^*.jpg ^*.JPG ^*.bmp ^*.BMP ^*.gif ^*.GIF ^*.tiff ^*.TIFF"
@ -11,11 +12,9 @@ echo "Processing $f"
ffmpeg -y -i "$f" -sample_fmt s16 -ar 48000 "${f%.flac}-16.flac" ffmpeg -y -i "$f" -sample_fmt s16 -ar 48000 "${f%.flac}-16.flac"
done done
while true; do if read -q "REPLY?Delete original files? "; then
read -p "Delete original files? " yn exec 2>/dev/null
case $yn in rm -- ^*-16.flac $IMG_FILES; exit
[Yy]* ) rm -- ^*-16.flac $IMG_FILES; exit;; else
[Nn]* ) exit;; printf "\nABORTING...\n"
* ) printf "Please answer yes or no. ";; fi
esac
done

Loading…
Cancel
Save