summaryrefslogtreecommitdiff
path: root/2flac
diff options
context:
space:
mode:
Diffstat (limited to '2flac')
-rwxr-xr-x2flac24
1 files changed, 24 insertions, 0 deletions
diff --git a/2flac b/2flac
new file mode 100755
index 0000000..3000f4c
--- /dev/null
+++ b/2flac
@@ -0,0 +1,24 @@
+#!/bin/bash
+# Convert APE (Monkey Audio Format) to FLAC using ffmpeg.
+
+set -euo pipefail
+
+usage() {
+ echo "Usage: $(basename "$0") [input file]..."
+ echo "Converts input files into FLAC format."
+ exit 0
+}
+
+main() {
+ if [ $# = 0 ]; then
+ usage
+ fi
+ for input in "$@"; do
+ if [ -f "$input" ]; then
+ output="${input%.*}.flac"
+ ffmpeg -loglevel error -hide_banner -i "$input" -acodec flac "$output"
+ fi
+ done
+}
+
+main "$@"