Batch Splitting of APE files from cue |
![]() ![]() |
Batch Splitting of APE files from cue |
Aug 30 2006, 17:18
Post
#1
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
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 |
|
|
|
Aug 30 2006, 17:35
Post
#2
|
|
|
Group: Super Moderator Posts: 4793 Joined: 1-April 04 Member No.: 13167 |
Check out shntool.
http://etree.org/shnutils/shntool/ This post has been edited by greynol: Aug 30 2006, 17:42 |
|
|
|
Aug 30 2006, 17:54
Post
#3
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
I've heard of this tool, but never really looked into it assuming it was strictly an SHN tool. Ooops! In reading through this, I believe this will do the trick for me. Thanks for the suggestion! Rich |
|
|
|
Aug 30 2006, 18:21
Post
#4
|
|
|
Group: Super Moderator Posts: 4793 Joined: 1-April 04 Member No.: 13167 |
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. |
|
|
|
Aug 30 2006, 18:30
Post
#5
|
|
![]() Group: Super Moderator Posts: 4732 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
|
|
|
|
Aug 30 2006, 18:40
Post
#6
|
|
|
Group: Super Moderator Posts: 4793 Joined: 1-April 04 Member No.: 13167 |
Does ACDIR require that build of MAC.exe that I mentioned earlier?
|
|
|
|
Aug 30 2006, 18:53
Post
#7
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
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 |
|
|
|
Aug 30 2006, 19:04
Post
#8
|
|
|
Group: Super Moderator Posts: 4793 Joined: 1-April 04 Member No.: 13167 |
Yes, that's a pretty big drawback with shntool that I forgot about! I use fb2k or EAC with a
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! This post has been edited by greynol: Aug 30 2006, 19:19 |
|
|
|
Aug 30 2006, 19:14
Post
#9
|
|
![]() Group: Super Moderator Posts: 4732 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
|
|
|
|
Aug 30 2006, 20:15
Post
#10
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
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. This post has been edited by maggior: Aug 30 2006, 20:17 |
|
|
|
Aug 31 2006, 11:26
Post
#11
|
|
![]() Group: Super Moderator Posts: 4732 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
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 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" ... This post has been edited by Synthetic Soul: Aug 31 2006, 15:54 |
|
|
|
Aug 31 2006, 12:45
Post
#12
|
|
![]() Group: Members Posts: 904 Joined: 14-September 05 From: Helsinki, Finland Member No.: 24472 |
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. This post has been edited by Alex B: Aug 31 2006, 13:00 |
|
|
|
Aug 31 2006, 15:51
Post
#13
|
|
![]() Group: Super Moderator Posts: 4732 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
I mentioned it briefly in #5....
It does deserve a second mention though; there seems no reason to not use. |
|
|
|
Aug 31 2006, 16:28
Post
#14
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
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! |
|
|
|
Aug 31 2006, 16:42
Post
#15
|
|
![]() Group: Super Moderator Posts: 4732 Joined: 12-August 04 From: Exeter, UK Member No.: 16217 |
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. |
|
|
|
Sep 5 2006, 16:14
Post
#16
|
|
|
Group: Members Posts: 132 Joined: 28-August 06 Member No.: 34552 |
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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 02:26 |