Skip to main content
Topic: Extract track from TAK file using command-line (Read 3955 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Extract track from TAK file using command-line

Hi,

I currently store my CD collection as single-file wavpacks, and am considering changing to TAK format.

One thing I do currently is use command-line tools to extract one of the tracks from the album file - at the moment I'm using getaudio, like this:
getaudio --begin 05:01:23 --end 07:22:51 input.wv | lame ....

However, getaudio doesn't support tak files.  Is there a tool that can work this way?  I'd really rather avoid extracting the whole tak file with takc, and I can't find any other command-line tools that understand .tak

Thanks

Extract track from TAK file using command-line

Reply #1
Do you have a cuesheet?
If you have cuesheet referencing TAK album image,  then you can use qaac (or refalac) like this (the following example decode the second track):
Code: [Select]
qaac -D --cue-track=2 foo.cue -o - | lame ...

Extract track from TAK file using command-line

Reply #2
If you have cuesheet referencing TAK album image,  then you can use qaac (or refalac)


Interesting idea - I don't have a cuesheet.  I suppose I could create a temporary one for the section I want, then use this.  Does seem to be jumping through hoops a bit though!

Extract track from TAK file using command-line

Reply #3
If you're using single files for whole albums, are you already using embedded cue sheets? Or are you just playing them with no cue points?

Extract track from TAK file using command-line

Reply #4
If you're using single files for whole albums, are you already using embedded cue sheets? Or are you just playing them with no cue points?


I do have the original album cue sheets embedded, but I sometimes recut albums, and then I just have a list of start/end points in a .csv file, which I process with Python.  I don't actually ever listen to the original files, they're my archive copy which I build my .ogg collection from.

Extract track from TAK file using command-line

Reply #5
ffmpeg has a native TAK decoder now. So you can use -ss for start and -t for duration.

Extract track from TAK file using command-line

Reply #6
If you have cuesheet referencing TAK album image,  then you can use qaac (or refalac) like this (the following example decode the second track):
Code: [Select]
qaac -D --cue-track=2 foo.cue -o - | lame ...

Can you explain to me how qaac would be able to decode a tak-file?

Extract track from TAK file using command-line

Reply #7
If you have cuesheet referencing TAK album image,  then you can use qaac (or refalac) like this (the following example decode the second track):
Code: [Select]
qaac -D --cue-track=2 foo.cue -o - | lame ...

Can you explain to me how qaac would be able to decode a tak-file?

How? Just through tak_deco_lib.dll . You have to place it somewhere in the PATH, or in the same directory as qaac.

Extract track from TAK file using command-line

Reply #8
Just released qaac 2.42 now, which supports --start and --end option.
If you want cuepoint mm:ss:ff format, the following should work:
Code: [Select]
refalac -D --start 05:01:23f --end 07:22:51f foo.tak -o- | lame...

(Since qaac/refalac supports 3 type of format to specfy the position, you need to put 'f')

Of course, using --cue-track is easier if you have an external cuesheet.

Extract track from TAK file using command-line

Reply #9
Just released qaac 2.42 now, which supports --start and --end option.


Wow, I'm seriously impressed at that turnaround speed!  Many thanks

Extract track from TAK file using command-line

Reply #10
How? Just through tak_deco_lib.dll . You have to place it somewhere in the PATH, or in the same directory as qaac.

Hmm, most interesting. Never knew qaac was capable of decoding other audioformats like that.
Now if only it were possible to copy the cue specific track tag afterwards, then you'd have a real alternative for foobar2000's converter. But too bad tag.exe --fromfile doesn't work with cuesheets.

Extract track from TAK file using command-line

Reply #11
Now if only it were possible to copy the cue specific track tag afterwards, then you'd have a real alternative for foobar2000's converter.

qaac copies most of the tags in the input file as well as metadata in cuesheet. All of four type cuesheet including noncompliant one written at http://wiki.hydrogenaud.io/index.php?title..._and_Cue_Sheets are supported.

Extract track from TAK file using command-line

Reply #12
Well, I might have been missed your point (what "afterwards" means)...
When you pipe into another encoder and want to tag it afterward... yes, there's nothing qaac can do.
However, since CAF output of qaac / refalac supports piping and tags are written to it, IF the encoder can handle CAF file input and metadata in it, tags can be transferred.

In short, the following example should work and metadata are copied to the resulting file.
Code: [Select]
qaac -D --caf foo.tak -o- | ffmpeg -i - bar.flac



Extract track from TAK file using command-line

Reply #13
That's exactly what I meant.



Source: 4ch quad TAK album.

Left: Converted with Foobar2000 (+Channel Mixer DSP to discard FC,LF,BL,BR) to WavPack (-hhx).
Right: qaac.exe -D --caf --cue-track=6 "Myths_and_Legends(tak,4ch,quad).cue" -o - | ffmpeg.exe -hide_banner -i - ^
-af "pan=stereo|c0=FL|c1=FR" -c:a wavpack -compression_level 4 "06.Across_the_River(qaac+ffmpeg,ch-remap).wv"


Binary Comparator (Foobar2000 component):
Quote
All tracks decoded fine, no differences found.

Comparing:
"D:\Storage\TEST files\Audio\Cuesheet\06.Across_the_River(foobar,ch-remap).wv"
"D:\Storage\TEST files\Audio\Cuesheet\06.Across_the_River(qaac+ffmpeg,ch-remap).wv"
No differences in decoded data found.
Very nice!

But, as you can see, "Comment" and "LOGFILE" don't get copied, "Artist" gets copied twice and both track fields get merged. Caf clearly has its own tag standard and isn't compatible with ID3/APE/Vorbis.

 
SimplePortal 1.0.0 RC1 © 2008-2018