diff options
author | cira0100 <40918547+cira0100@users.noreply.github.com> | 2023-06-16 00:52:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 00:52:48 +0200 |
commit | 400779dcbdb19a514fa8336f48c77b2e8a1adb2f (patch) | |
tree | d8b39bd8f132b676a1aa0fc0fcdb2e44fd4a954d /mp3Convert.sh |
Diffstat (limited to 'mp3Convert.sh')
-rw-r--r-- | mp3Convert.sh | 13 |
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 {} \; + |