shntool split -f *.cue -o flac *.flacBut I recently tried the same command on some other Flac files and got the following error message:
shntool [split]: error: m:ss.ff format can only be used with CD-quality filesA suggestion on linuxquestions.org was to use a similar command to this (where you have one Flac file and one cue file; you'll have to specify the names if you have more than one in the folder obviously):
cuebreakpoints *.cue | sed s/$/0/ | shnsplit -o flac *.flacHowever, I ran into a similar error as another poster there:
shnsplit: warning: error while transferring -4195974166 bytes of data shnsplit: error: failed to split fileI noticed that in both cases it was the final track that failed to split.
A workaround is to add a extra dummy track to the end of the cue file, using the track length of the origianl Flac file from file properties.
The final track is then spit successfully and the error message appears when the program tries to slit the dummy track.
Once the Flac file is successfully split, to add tag information to the split files from the cue file, use this command:
cuetag *.cue split-track*.flacTo change the file names to track titles from the cue file, use this script:
#!/bin/bashAuthor: Ruben Verweij
for f in *.flac; do
track=`metaflac "$f" --show-tag=TRACKNUMBER | sed s/.*=//g`
artist=`metaflac "$f" --show-tag=ARTIST | sed s/.*=//g`
title=`metaflac "$f" --show-tag=TITLE | sed s/.*=//g`
mv "$f" "`printf %02g $track` - $artist - $title.flac"
done
All work perfect, thanks!.
ReplyDeletePd: also we can add the album cover with Kid3