Created
October 6, 2025 15:14
-
-
Save jmarhee/56fb58172cdb5d4c5101d56545e9d6ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Assumes a filename ${artist} - ${title}.mp3 | |
## If not already in mp3: | |
# for f in *.m4a; do ffmpeg -i "$f" -vn -ar 44100 -ac 2 -b:a 192k "${f%.*}.mp3"; done | |
## Assumes album cover art at ./cover.jpg | |
ALBUM_NAME=$1 | |
ALBUM_ARTIST=$2 | |
for f in *.mp3; do | |
artist=$(echo "$f" | cut -d '-' -f1) | |
# Removes file extension from title string, leading whitespace following delimiter: | |
track=$(echo "$f" | cut -d '-' -f2 | sed -e 's|.mp3||g' -e 's/^[[:space:]]*//') | |
eyeD3 "$f" --artist="$artist" \ | |
--album-artist="$ALBUM_ARTIST" \ | |
--title="$track"\ | |
--album "$ALBUM_NAME"\ | |
--add-image "cover.jpg:FRONT_COVER" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment