summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mp3Convert.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/mp3Convert.sh b/mp3Convert.sh
new file mode 100644
index 0000000..b6a8023
--- /dev/null
+++ b/mp3Convert.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Set the source directory containing FLAC files
+source_dir="$HOME/Desktop/music"
+
+# Find FLAC files and convert them to MP3
+find "$source_dir" -type f -iname "*.flac" -exec bash -c '
+ flac_file="$1"
+ mp3_file="${flac_file/%.flac/.mp3}"
+ echo "Converting: $flac_file"
+ ffmpeg -i "$flac_file" -ab 320k -map_metadata 0 -id3v2_version 3 "$mp3_file" && rm "$flac_file"
+' bash {} \;
+