Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: This script converts APE cue/bin to single flac files (Read 5580 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

This script converts APE cue/bin to single flac files

I have made this script for Linux that converts an APE compressed bin file to single flac files.

NOTICE1: it deletes the original files, so you only end up the flac files, a list of the song titles (in case you want to import the song names with EasyTag.sf.net) and the cue file.

NOTICE2: During convertion it needs ~2x of disk space of the ape file size.

NOTICE3: As far as I know only Debian have a fixed version of bchunk, so if you (like me) doesn't use Debian, you have to download Debian's patch, and compile bchunk yourself. Without the fixed version of bchunk, the all songs will have wrong offsets!

Code: [Select]
#!/bin/sh

APE="$(echo *ape)"
CUE="$(echo *cue)"
AUD="audio.raw"

mac "$APE" "$APE.wav" -d
rm "$APE"

WAV="$(echo *wav)"
sox "$WAV" "$AUD"
rm "$WAV"

#rpl .ape .ape.wav "$CUE"

/usr/local/bin/bchunk -w "$AUD" "$CUE" track
rm "$AUD"
#rm "$CUE"

flac --best track*
rm track*wav

sed -n 's/    TITLE "\(.*\)"/\1/p' "$CUE" > songnames.txt