From ff09a81c76ded79f43041626e488d240c5e9fda5 Mon Sep 17 00:00:00 2001 From: Robin Steinberg Date: Sun, 7 Apr 2024 20:56:24 +0200 Subject: [PATCH] Initial commit --- mp3convert | 13 +++++++++++++ tidalconvert | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100755 mp3convert create mode 100755 tidalconvert diff --git a/mp3convert b/mp3convert new file mode 100755 index 0000000..53a2662 --- /dev/null +++ b/mp3convert @@ -0,0 +1,13 @@ +#!/bin/bash + +FLAC="$1" +OUT_DIR="mp3" +# get filename without extension +FILENAME="${FLAC##*/}" +# make filename with .mp3 extension +MP3="./${OUT_DIR}/${FILENAME%.flac}.mp3" + +mkdir -p "$OUT_DIR" +if [[ ! -f "$MP3" ]]; then + ffmpeg -i "$FLAC" -c:a libmp3lame -b:a 320K -map a:0 "$MP3" +fi diff --git a/tidalconvert b/tidalconvert new file mode 100755 index 0000000..aa5ee7b --- /dev/null +++ b/tidalconvert @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir -p flac +mv *.flac flac/ +# call mp3convert on every file inside the flac directory +find flac -name '*.flac' -exec bash -c 'mp3convert "$1"' _ {} \; +