Update scripts to make them more versatile:

- Support WAV
- Directories are now name original and converted
- Keep and copy mp3 and m4a files without reencoding them
- Fix mp3convert failing when there is no cover art
This commit is contained in:
2026-06-05 22:08:26 +02:00
parent ff09a81c76
commit 978bcf9478
3 changed files with 43 additions and 12 deletions
+5 -5
View File
@@ -1,13 +1,13 @@
#!/bin/bash
FLAC="$1"
OUT_DIR="mp3"
INPUT_FILE="$1"
OUT_DIR="$2"
# get filename without extension
FILENAME="${FLAC##*/}"
BASE_NAME="${INPUT_FILE##*/}"
# make filename with .mp3 extension
MP3="./${OUT_DIR}/${FILENAME%.flac}.mp3"
MP3_FILE="./${OUT_DIR}/${BASE_NAME%.*}.mp3"
mkdir -p "$OUT_DIR"
if [[ ! -f "$MP3" ]]; then
ffmpeg -i "$FLAC" -c:a libmp3lame -b:a 320K -map a:0 "$MP3"
ffmpeg -i "$INPUT_FILE" -c:a libmp3lame -b:a 320K -map a:0 -map v:0? -c:v copy "$MP3_FILE"
fi