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: Batch Splitting of APE files from cue (Read 10500 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Batch Splitting of APE files from cue

I have a large number of APE files whch are CD images accompanied by a cue sheet.  I would like to split these into indivudual tracks since it better meets my needs.

I found a great program called "cue splitter" which works great, but it doesn't have a batch mode.  What's cool about this tool is a conversion to wave prior to splitting is not required. 

Since I have 100's of these to convert, I'd perfer to be able to do it in a batch mode.

Does anybody know of a tool that can automate this process?

Thanks!
Rich



Batch Splitting of APE files from cue

Reply #3
You're welcome.

You'll probably need the build of Monkey's Audio that allows for piping.

Direct link:
http://www.rarewares.org/files/ogg/MAC.zip

Found on page:
http://rarewares.org/ogg.html

Also be aware that the first line in the cue sheet must be the "FILE" line.

Batch Splitting of APE files from cue

Reply #4
Another command line alternative is the brilliant ACDIR.

I have a small guide here.

Or, if you want GUI, there's always foobar of course.
I'm on a horse.


Batch Splitting of APE files from cue

Reply #6
Great response to my question.

I've looked at SHNtool more closely and it has one drawback which is critical - the output file names are based on a prefix and track number.  It does not extract the title information from the cue sheet and name the output file based on that.

I'll check out ACDIR - that may fit the bill.  Or, I've downloaded the source for SHNTool - perhaps some minor code changes would get the output file name that I want.  Though that would require more in-depth parsing of the cue sheet.  I'll have to see.

I'll also have to check the cue sheets I'm working with to see if they are "simple", i.e. the first line is FILE.

What a great forum!

I'm still open to other suggestions if anybody has any.  At least now I have some options to check out.

Cheers!
Rich

Batch Splitting of APE files from cue

Reply #7
Yes, that's a pretty big drawback with shntool that I forgot about!  I use fb2k or EAC with a mounted converted image for this rather than a batch since it doesn't happen all that often for me.

You could have your batch file parse the cue sheet in order to (a) strip all lines before the FILE line and (b) get title information to rename the individual tracks.  This is probably more work than you want to deal with.

Hopefully ACDIR will better suit your needs.  If you do alter any code, please share!

Batch Splitting of APE files from cue

Reply #8
Does ACDIR require that build of MAC.exe that I mentioned earlier?
No, IIRC it is compiled using the MAC lib, so it has "inbuilt" decoding of APE files, as well as FLAC and WV.
I'm on a horse.

Batch Splitting of APE files from cue

Reply #9
OK, just from reading, ACDIR looks like exactly what I need. :-) 

One thing I'm confused about is the output.  Is it true that to generate output other than wave files that you have to pipe to an external encoder?  I see that the tool is linked with a variety of libraries (flac, ape, wave pack) - are these only used for decoding?

What I want to do is split the ape images into tracks and have the output in FLAC format (my personal perference).  Do I need to use the pipe option to do this?  If no, how do I specify that the output should be in FLAC - just by appending .flac to the output file name?

Since all of the examples are in terms of LAME, I wasn't clear on how to transcode between lossless formats.

This looks like an awesome tool - thanks for the heads up on it.

Cheers!
Rich

BTW Synthetic Soul - nice tutorial.  It will help a lot with figuring out the string needed to generate the format of the file names I want.

Batch Splitting of APE files from cue

Reply #10
Yes, The mention of Monkey's Audio WavPack and FLAC are purely with regard to decoding.  ACDIR uses the respective libraries so it natively understands these formats as well as WAVE.

You have two main options.  You either split to wave and then use some other app to convert the waves to your format of choice (ACDIR's --extract switch), or you use ACDIR to pipe directly to the encoder (ACDIR's --pipe switch).

Luckily for you, FLAC supports encoding from STDIN, so you can use --pipe.

As you have bothered to look at my guide (kudos for a bit of attempted self-help) I will adapt an example from there to help you associate:

In the example from my guide I pipe to LAME, using a cuesheet pointing to an APE file:

ACDIR.EXE --output "F:\$~A\$~T\$n - $~t.mp3" --pipe "LAME.EXE -V5 --tt $#t --ta $#a --tl $#T --tn $n - $#o" "E:\CDBackUp\Green Day\American Idiot\CDImage.ape.cue"

This could be adapted to:

ACDIR.EXE --output "F:\$~A\$~T\$n - $~t.flac" --pipe "FLAC.EXE -8 -T $qTITLE=$t$q -T $qTRACKNUMBER=$n$q  -T $qARTIST=$a$q -T $qALBUM=$T$q -T $qDATE=$R{DATE}$q -T $qGENRE=$R{GENRE}$q - -o $#o" "E:\CDBackUp\Green Day\American Idiot\CDImage.ape.cue"

Notice the use of the token $q to insert double quotes.  The FLAC command is already inside double quotes, so ACDIR uses this token which is replaced before execution.

I don't have American Idiot here, so I tested with The Clash's self-titled album (Edit: possibly an album name different to the artist name may have been a better example in retrospect ).  Here's an example of what ACDIR runs, using the example above (but with different paths ("F:" => "C:\Documents and Settings\Neil\My Documents\Audio" and "E:\CDBackUp\Green Day\American Idiot\CDImage.ape.cue" => "C:\Documents and Settings\Neil\My Documents\Audio\The Clash - The Clash.cue"):

FLAC.EXE -8 -T "TITLE=Janie Jones" -T "TRACKNUMBER=01"  -T "ARTIST=The Clash" -T "ALBUM=The Clash" -T "DATE=1977" -T "GENRE=Rock" - -o "C:\Documents and Settings\Neil\My Documents\Audio\The Clash\The Clash\01 - Janie Jones.flac"

FLAC.EXE -8 -T "TITLE=Remote Control" -T "TRACKNUMBER=02"  -T "ARTIST=The Clash" -T "ALBUM=The Clash" -T "DATE=1977" -T "GENRE=Rock" - -o "C:\Documents and Settings\Neil\My Documents\Audio\The Clash\The Clash\02 - Remote Control.flac"

...
I'm on a horse.

Batch Splitting of APE files from cue

Reply #11
No one has posted the standard HA answer yet: foobar2000. Is it suddenly out of fashion?

I know that it is not especially a batch tool, but it can easily convert APE + CUE files to separate track files in batches. (I assume that the OP uses a Windows PC and the cue files contain correct file names with the .ape filename extensions.)

I always just drag a bunch of cues to a playlist (actually, mostly APL files, but it is practically the same thing) and convert to any supported format without problems. The folder structure and file names can be fully configured and foobar also writes the file tags.

foobar2000 v. 0.9x Monkey's Audio plugin was said to be buggy (some months ago), but the only problem I have stumbled on recently was APL related (APL = Monkey's Audio link file). I assisted in debugging the problem in this thread and the bug is fixed now.

Also, foobar2000 v. 0.83 Special Installer works fine without any APE, APL or CUE problems.

Batch Splitting of APE files from cue

Reply #12
I mentioned it briefly in #5....

It does deserve a second mention though; there seems no reason to not use.
I'm on a horse.

Batch Splitting of APE files from cue

Reply #13
Again, thanks a bunch for the huge amount of help.

Since the forums were down last night, I spent some time mucking about with this and figured out the necessary ACDIR options, but then found myself struggling with the options for flac.exe.  Up until now I've been shielded from the command line of flac.exe since I would either use flacfrontend.exe or dbpoweramp.exe for my encoding.

It took me a bit to determine that you need to use the "-" option to flac.exe to force it to take input from stdin :-).

I was keeping it simple and not even worrying about passing the tags to flac.exe, so I hadn't even hit the $q issue.  Thanks for the heads up on that!!  Looking at what you put together, I'm not sure what I did differently that kept it from working.  It was getting late, so I was probably doing something stupid.  My last attempt had output going to my screen and sending my PC speaker into fits.  That's when I decided it was time to retire for the night.

So, all I need to do now is take the command that you've so kindly posted here and tweek it to my specific needs.  It's always easier to have something that works as a starting point.

Thanks so much!!!
Rich


Just one last question to help me understand the fine details - when ACDIR pipes the decoded data to the encoder using --pipe, is it the raw decoded data stream or is it the data that would normally be sent to the .wav file, including all header info?  Since your sample command doesn't specify any of the format information regarding the data stream, I'm assuming header info is passed along, which flac.exe then parses.  But this could also be because the defaults used by flac.exe just happen to work.

Cheers!

Batch Splitting of APE files from cue

Reply #14
You probably weren't specifying the -o switch to output to file, in which case it would default to STDOUT, writing lots of crap to the console including character combinations that make the BEEP noise.  This is more embarrassing when you do it at work, while you are supposed to be doing other things, and your colleagues are wondering why your machine is BEEPing continually, as I discovered a while back now.

I'm probably not the best to answer your question, as I get confused with the technicals, but my understanding is that it is raw data, no header.  The only differerence when writing to WAVE is that a header would be written first.  I really shouldn't worry about these things though!  Sufficing to say ACDIR knows how to write it, and FLAC knows how to read it.
I'm on a horse.

 

Batch Splitting of APE files from cue

Reply #15
Just an update for those that might be interested...

I tried foobar2000 and it does just what I need, but with a nice GUI to work with.  I didn't realize you could drag .cue file into it.  Up to now, I've only used it to drag .flac, .shn, or .ape files in to play them.

So, my plan is to use Windows explorer to search for all .cue files, drag them into foobar2k, and tell it to split and convert to FLAC.  Done!

I will keep ACDIR in my hip pocket for future needs where I truely need to convert in a batch environment.  It's always good to know what tools are at your disposal.

Again, thanks so much for the help on this topic.