In case if you’re an active user of torrent networks like me you may discover one day you have a lot of music stored as APE-compressed AudioCD disk images. Although nothing bad, it is rather hard to manage a big music collection stored like this and navigate between tracks while listening this music. Recently I decided to convert the entire collection to the separate FLAC-compressed tracks, and here’s how you can achive the same.

  • Install audio/cuetools and audio/shntool packages (or whatever it called in your 3rd party software manager)
  • Install audio/flac package (you’ll need metaflac to tag resulted files)
  • Split the big APE file to separate FLAC-compressed tracks:

    cuebreakpoints my_favorite_music.cue  | \
        shnsplit -o flac my_favortite_music.ape
    
  • Add metadata information to FLAC tracks:

    /usr/local/share/examples/cuetools/cuetag.sh \
        my_favorite_music.cue *.flac
    
  • Rename resulted files (optional). I use the following script:

    #!/bin/csh
    set c=0
    foreach i (`echo *.flac`)
            set name=`metaflac --show-tag=TITLE $i | \
                sed -E -e 's,TITLE=,,' -e 's,[[:space:]]+,_,g'`
            set filename=`printf %.2d__%s ${c} ${name}`
            mv ${i} "${filename}".flac
            set c=`expr ${c} + 1`
    end
    

After that you’ll receive a number of properly named flac tracks in the working dir. Enjoy!

2 Responses to “Converting APE+CUE images to FLAC tracks”

  1. Bapt Says:

    I do it like that : ffmpeg -vn -i toto.ape toto.flac then metaflac --import-cuesheet-from=toto.cue toto.flac

    now you can split your flac in multiple tracks.

    Anyway, I'll keep your way to do it in bookmark

  2. stass Says:

    Thanks!

    I was not aware of this metaflac functionality. Will try this method the next time.

Sorry, comments are closed for this article.