Created
August 8, 2014 12:23
-
-
Save lisovy/b9ad0f4b5bc2e052b4c9 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 | |
if [ $# -ne 2 ]; then | |
echo -e "Usage: $0 FLAC_FILE CUE_FILE\n" | |
exit 1; | |
fi | |
FLAC_FILE=$1 | |
CUE_FILE=$2 | |
echo -e "### Splitting audiofile ###\n" | |
cuebreakpoints "$CUE_FILE" | shnsplit -o flac "$FLAC_FILE" | |
echo -e "### Saving tags into files ###\n" | |
cuetag "$CUE_FILE" split-track*.flac | |
echo -e "### Renaming audio files regarding its tags ###\n" | |
for X in split-track*.flac; do | |
NEWNAME1=$(mp3info2 -p "%n" $X) | |
NEWNAME1=$(printf %02d $NEWNAME1); # leading zero | |
NEWNAME2=$(mp3info2 -p "%t" $X) | |
mv $X "${NEWNAME1} -- ${NEWNAME2}".flac | |
done | |
echo -e "### Done! ###\n" | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment