music-to-mp3.sh: support multiple arguments
authorColin P. McCabe <cmccabe@apache.org>
Mon, 19 Jun 2023 20:02:35 +0000 (13:02 -0700)
committerColin P. McCabe <cmccabe@apache.org>
Mon, 19 Jun 2023 20:02:35 +0000 (13:02 -0700)
music-to-mp3.sh

index 0259f7b..2028e48 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/bash
 
-FILE=$1
-echo "Re-encoding audio from ${FILE}..."
-ffmpeg -i "${FILE}" -vn -ac 2 -ar 44100 -ab 220k -f mp3 "${FILE}.mp3"
+echo "Re-encoding audio from ${@}..."
+for FILE in "$@"; do
+    ffmpeg -i "${FILE}" -vn -ac 2 -ar 44100 -ab 220k -f mp3 "${FILE}.mp3"
+done