Help - Search - Members - Calendar
Full Version: FLAC with embedded cuesheet
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
Pages: 1, 2, 3
schnittlich
I have searched through he archives and found a few different techniques described for creating a FLAC file with an embedded cuesheet, but all seem to take multiple steps (i.e. EAC – copy image and create cuesheet, then use FLAC front-end to compress the wave and embed the cuesheet). Is there any way to accomplish the task, either via EAC or PlexTools, in a single step?

brett


Learn not to write topic title in all caps - moderation
Synthetic Soul
Set EAC to use an external compressor. Select FLAC as the encoder and add the text "--cuesheet=<path to CDImage>\CDImage.flac.cue" to the command line options.

Where <path to CDImage> is the path to where you will save the image.

To convert the CD select Action > Copy Image & Create CUE Sheet > Compressed... from the menu, and leave the filename as "CDImage.flac" (or amend the command line options accordingly).

If you need a more detailed explanation please post back.

NB: I don't use flac, but I don't see why this won't work.

I wrote a guide to do something very similar using EAC with Monkey's Audio - it may be worth taking a look if you have no idea what I am on about, as it may introduce you to using an external compressor in EAC.

[url=http://www.neilpopham.pwp.blueyonder.co.uk/cd_backup.html]Set EAC to use an external compressor. Select FLAC as the encoder and add the text "--cuesheet=<path to CDImage>\CDImage.flac.cue" to the command line options.

Where <path to CDImage> is the path to where you will save the image.

To convert the CD select Action > Copy Image & Create CUE Sheet > Compressed... from the menu, and leave the filename as "CDImage.flac" (or amend the command line options accordingly).

If you need a more detailed explanation please post back.

NB: I don't use flac, but I don't see why this won't work.

I wrote a guide to do something very similar using EAC with Monkey's Audio - it may be worth taking a look if you have no idea what I am on about, as it may introduce you to using an external compressor in EAC.

http://synthetic-soul.mysite.wanadoo-membe.../cd_backup.html

Edit: added <path to CDImage> bit

Edit 2005-01-13: Updated URL to blueyonder address/cd_backup.html[/url]
Synthetic Soul
As a nice touch you could also try the following:

Add the text "%h--best%h" to the command line.

You can then use the High and Low Quality radio buttons on the EAC compression options dialogue to switch between compression level 8 (High quality) and 5 (Low quality)

Alternatively add "%h-8%h %l-5%l" and replace -8 and -5 with the compression levels you might suggest for High and Low quality (e.g.: -6 and -0).

You can use the CRC checkbox in a similar manner, to specify some other boolean flag, like "--verify".

My suggested command line would be:

%h-8%h %l-5%l %c--verify%c --cuesheet=<path to CDImage>\CDImage.flac.cue %s
rfarris
Because the OP is choosing "Create Image and cuesheet," he's going to get an external cuesheet, anyway. Do you see any advantage in also having an embedded flac cuesheet, considering the limited functionality of the embedded version?
Synthetic Soul
QUOTE(rfarris @ Sep 25 2004, 11:22 PM)
Because the OP is choosing "Create Image and cuesheet," he's going to get an external cuesheet, anyway.  Do you see any advantage in also having an embedded flac cuesheet, considering the limited functionality of the embedded version?
*


Perhaps someone could explain the cons of the FLAC embedded cuesheet. I do remember reading that EAC cuesheets are not stored in full, but I can't remember why. Does FLAC strip all PERFORMER/TITLE info?

To embed a cuesheet using this method it will always be necessary to create a cuesheet file in the first place, as the tag sets the value from an external file.

As to the benefit of having one FLAC file rather than one FLAC file + one CUE file... who knows. One of the key goals of my method described in my guide was to get an APE file with embedded cuesheet - but now I have come to actually put my system into practice I am adding the cuesheet as an APEv2 tag and keeping the CUE file as well - as I figured: why not? Foobar will split a file into tracks using the CUESHEET tag - will it do the same if you load a FLAC file with accompanying (unembedded) cuesheet?

If a one-file solution is definately desired/required, and the cuesheet tag is unsuitable due to FLAC-imposed restrictrictions, then they could always add it as a different tag, like "CUE", which presumably wouldn't edit the content at all. They would lose some functionality, like foobar's, but it would maintain the goal of a one step, one file, approach.
schnittlich
QUOTE(Synthetic Soul @ Sep 25 2004, 01:51 PM)
Set EAC to use an external compressor.  Select FLAC as the encoder and add the text "--cuesheet=<path to CDImage>\CDImage.flac.cue" to the command line options.

Where <path to CDImage> is the path to where you will save the image.

To convert the CD select Action > Copy Image & Create CUE Sheet > Compressed...  from the menu, and leave the filename as "CDImage.flac" (or amend the command line options accordingly).

If you need a more detailed explanation please post back.

NB: I don't use flac, but I don't see why this won't work.

I wrote a guide to do something very similar using EAC with Monkey's Audio - it may be worth taking a look if you have no idea what I am on about, as it may introduce you to using an external compressor in EAC.

http://synthetic-soul.mysite.wanadoo-membe.../cd_backup.html

Edit: added <path to CDImage> bit
*




synthetic soul - just checked out your link. THANKS!!! after some experimentation, i think i will go with monkey as opposed to flac, based on the fact that i can embed the entire tag (artist, album, song, genre) and playback properly within foobar2000.

one additional question?

would you know of a way to change the final file's name via the script?

in other words, after the process is complete, we always have a file named <cdimage.ape>, therefore making it difficult to perform this process on a large collection in batch. do you know how to have the file's name change automatically to <artist_album.ape> based on the tag?

thanks again,

brett
Synthetic Soul
QUOTE(schnittlich @ Sep 26 2004, 09:23 PM)
would you know of a way to change the final file's name via the script?

in other words, after the process is complete, we always have a file named <cdimage.ape>, therefore making it difficult to perform this process on a large collection in batch.  do you know how to have the file's name change automatically to <artist_album.ape> based on the tag?
*
I have finally gotten around to archiving my CDs - I'm about 1/3 of the way through (I hope!).

However, for the scripts I am using, I have made a few changes to the system described in my my guide.
  • I append the prosed backup DVD disc number to the EAC command line. I then append this disc number, artist, album, date and time to a single CSV file, which is gradually building up a full list of all CDs I have archived, and what backup DVD they are stored on. I am writing this CSV log to every DVD disc, but it will be most useful on the final disc, where it will be complete, and can tell me exactly where to find the album I'm after.
  • I create an Artist\Album folder structure from the batch file, and once all processing has been done I move everything to this folder. The reason I do it this way is that I can just tell EAC to write to the same folder each time ("E:\CDBackup"), without having to manually create the folder structure - let the script do the work!
  • All information written to the console is also written to a log file, "eac-enc.log", so I have a record of what has happened
If you would like a copy of the batch files I am using post back and let me know.

If you are planning to use PAR2 then renaming files probably isn't a good idea - which is why I stick to calling all mine "CDImage" and storing them in separate folders.

I can provide code to rename files from "CDImage" to "<artist>_<album>" if you still want it - I just wouldn't recommend it if you are using PAR2 also. If you aren't then I guess it would make sense. The reason I haven't posted it now is that it is slightly complicated, as the script has to remove illegal filename characters from the text before it can be used as a folder or file name. It would probably be easier for me to throw you an alternate batch file, rather than explain it here. Let me know.
rfarris
QUOTE(Synthetic Soul @ Sep 26 2004, 01:40 AM)
QUOTE(rfarris @ Sep 25 2004, 11:22 PM)
Because the OP is choosing "Create Image and cuesheet," he's going to get an external cuesheet, anyway.  Do you see any advantage in also having an embedded flac cuesheet, considering the limited functionality of the embedded version?
*
Perhaps someone could explain the cons of the FLAC embedded cuesheet. I do remember reading that EAC cuesheets are not stored in full, but I can't remember why. Does FLAC strip all PERFORMER/TITLE info?
*

Yup. Nothing in there but track and index tags. According to Josh, the embedded cue sheet is strictly for the purpose of re-creating the original CD.

By having an external cue sheet and using FB2K, you get artist, title, replay-gain and anything else you might like.
Synthetic Soul
QUOTE(rfarris @ Sep 27 2004, 05:46 PM)
Yup.  Nothing in there but track and index tags.  According to Josh, the embedded cue sheet is strictly for the purpose of re-creating the original CD.

By having an external cue sheet and using FB2K, you get artist, title, replay-gain and anything else you might like.
*

Thanks for the clarification.

I can't say I totally disagree - even though I have chosen to store Artist/Album/Title info I doubt I will use it when it comes to re-creating a CD.

Using an embedded cuesheet in an APE file you also get artist and title info in foobar - I don't know about replay gain as I have yet to use it (although I am keen).
menders
You can always embed the cuesheet in the CUESHEET tag in the FLAC file. The foobar flac component will read that as well and it will keep all the artist/track information.
ponchorage
Synthetic Soul:

I'd love to get a copy of your batch files and the script to rename the image files. I'm working on similar scripts that work with flac files.
Synthetic Soul
QUOTE(ponchorage @ Sep 28 2004, 06:00 AM)
I'd love to get a copy of your batch files and the script to rename the image files. I'm working on similar scripts that work with flac files.
*

I am at work now, but I will upload my batch files tonight if I can (I have a newborn and things are pretty crazy right now!).

To create valid folder/file names from any parameter I have created the following "function" (I'm not familiar with batch file programming, so this may be poor practice), which takes a string and replaces any invalid character (in theory) with a space (as EAC seems to):

CODE
:MakePath
SET tmpString=%~1
SET tmpString=%tmpString:/= %
SET tmpString=%tmpString:\= %
SET tmpString=%tmpString::= %
SET tmpString=%tmpString:?= %
SET tmpString=%tmpString:"= %
SET tmpString=%tmpString:^<= %
SET tmpString=%tmpString:^>= %
SET tmpString=%tmpString:^|= %
REM Now remove asterisks...
SET tmpString=%tmpString: =/%
SET tmpString=%tmpString:,=\%
SET output=
SET /A counter=-1
:MakePathNextChar
SET /A counter+=1
CALL :EXEC SET char=%%tmpString:~%counter%,1%%%
if NOT DEFINED char GOTO :MakePathDone
if [%char%] EQU [*] SET char=/
SET output=%output%%char%
GOTO :MakePathNextChar
:MakePathDone
SET output=%output:/= %
SET output=%output:\=,%
SET %2=%output%
GOTO:EOF
:EXEC
%*
GOTO:EOF

I call this using this format:

CODE
CALL :MakePath "<input text>" <output variable name>

E.g.:

CODE
CALL :MakePath %4 artistFolder
CALL :MakePath %5 albumFolder

If %4 is "AC/DC" %artistFolder% wil be AC DC.

You could therefore rename a file, as per schnittlich's request, by doing:

CODE
CALL :MakePath %4 artistFilename
CALL :MakePath %5 albumFilename

REN "%~dp3%~n1.*" "%artistFilename%_%albumFilename%.*"

... ensuring that the MakePath "function" is at the foot of your batch file.

I have found this site to be invaluable while creating my batch files. That said, I am in no way an expert - these batch files are by far the most complex I have written - so please feel free to use this code, but don't take my methods as gospel!

Edit: updated MakePath function to reflect my current version at home
rfarris
QUOTE(menders @ Sep 27 2004, 11:40 AM)
You can always embed the cuesheet in the CUESHEET tag in the FLAC file. The foobar flac component will read that as well and it will keep all the artist/track information.
*


Perhaps the new flac works that way, but 1.1.0 doesn't. You feed it a perfectly annotated cuesheet and it strips out everything that Josh thinks is extraneous. It's not a bug, it's a feature.
menders
QUOTE(rfarris @ Sep 28 2004, 08:29 AM)
QUOTE(menders @ Sep 27 2004, 11:40 AM)
You can always embed the cuesheet in the CUESHEET tag in the FLAC file. The foobar flac component will read that as well and it will keep all the artist/track information.
*


Perhaps the new flac works that way, but 1.1.0 doesn't. You feed it a perfectly annotated cuesheet and it strips out everything that Josh thinks is extraneous. It's not a bug, it's a feature.
*



You're right if you're talking about Josh's tools. I'm talking about Case's foobar2000 flac component. It will read the cuesheet from a tag named "CUESHEET". Try it.
jcoalson
to further clarify, there is a specific CUESHEET metadata block which is where the data from --cue-sheet=... goes.

the foobar component adds a field in the tags (VORBIS_COMMENT metadata block) with field name "CUESHEET" e.g.

CUESHEET=TITLE "blah blah"
ARTIST "blah blah"
.
.
.

Josh
Synthetic Soul
The batch files I have been using have been uploaded to:

http://synthetic-soul.mysite.wanadoo-membe...files_2_0_0.zip

The command line I am using in EAC is:

/c C:\dos\eac-enc.bat %o %s %d "%a" "%g" %hHIGH%h %lLOW%l 01

... where 01 is the intended DVD disc number that this album will be backed up to. Every time I back up a load of directories to a DVD I delete them and increase this number manually.

All other settings are as per my guide:

http://synthetic-soul.mysite.wanadoo-membe.../cd_backup.html


Please let me know how you get on. I'm all up for improving them.

Addendum:

As well as setting the paths to MAC, TAG and PAR2 as per the guide, you will also need to set the paths for files to be created/moved:

CODE
REM =====================================================
REM  PLEASE EDIT THE PATHS TO THE STORAGE FOLDERS
REM =====================================================
SET apeFolder=E:\CDBackup\APE
SET csvLogFolder=E:\CDBackup\Log
SET eacEncLog=E:\CDBackup\eac-enc.log


apeFolder is the folder in which the album\artist folders will be created, and subsequently all files in the source directory moved to.
csvLogFolder is the folder in which to create and update the CSV file.
eacEncLog is the path to the log file to write for each encode.

When choosing "Action > Copy Image & Create CUE Sheet > Compressed..." from EAC I choose to create "CDImage.ape" in "E:\CDBackup". EAC creates its log in this folder, and so do my batch files (see eacEncLog). Once everything is done all files in "E:\CDBackup" are moved to "E:\CDBackup\APE\<Artist>\<Album>". NB: I also have a folder, "E:\CDBackup\Software", in which I have a copy of all relevant software. This folder, along with "\APE" and "\Log", is burnt to each DVD - to ensure I have all the tools I need to re-create my CD.

Hope this makes sense. I guess I'll update my guide sometime soon.

Edit 2005-01-13: Updated URL to blueyonder address/cd_backup.html[/url]
leland
Question for you, why is it a problem to rename files when using par2?

I'm re-commencing my "big rip" project and had pretty much decided to go with multiple flacs and an external (non-standard) cuesheet in case I want to recreate the cd.

I like having the single files as I can play them on my Karma if I choose, and I think they'll be easier to work with on any future device that plays lossless. It also makes metadata easier to handle (don't need to worry whether it will play .cue or not). That's an aside, I enjoy reading about everyone's o/c systems.

I digress, eventually I'd like to back this stuff up properly, so I'm curious about the par2.
Synthetic Soul
QUOTE(leland @ Sep 29 2004, 03:32 PM)
Question for you, why is it a problem to rename files when using par2?
*

In all honesty it's not a major problem - it just means that you've got to write a slightly longer command line to verify or repair.

Update: I appear to have proved otherwise. Please see my next post, below. This post left for reference/archive purposes only - I think the majority of it is incorrect now!

If you create your PAR2 files with the final file name, to verify you just have to use:

CODE
PAR2 v CDImage.ape.par2

If you rename the file after you've created your PAR2 files, to verify you will need to use:

CODE
PAR2 v CDImage.ape.par2 Pixies_Doolittle.ape

I must admit I didn't know the resolve was so easy when I decided that you needed to run PAR2 on the final filename. I shall stop making such statements now.

However, bear in mind that, if you run PAR2 while EAC has the .ape file named using its temporary filename (which you would have to, if you called it from MAREO or a single batch file), e.g.: "Ctmp7!1!5.ape", you will have to be dealing with some confusing command lines, e.g.:

CODE
PAR2 v Ctmp7!1!5.ape.par2 CDImage.ape

... which does make verifying and repairing that little bit more awkward. I would rather take a few extra steps to ensure that the verifying process is as simple and intuative as possible (i.e.: typing "PAR2 v CDIMage.ape.par2" every time - rather than having to write a unique command line per .ape file).

This is the reason my backup system uses two batch files: to get EAC to rename the file from the temporary name to the final name in between the two. PAR2 then runs in the second (eac-post.bat) referencing the final filename.

Edit: added link to post RE: MAREO and PAR2
Synthetic Soul
In fact it is worse than I thought, at least according to my test.

The dump below shows me creating PAR2 files from a "temporary file" ("Ctmp7!1!5.wv"), and then attempting to verify. As you will see, the process is overly complicated. The main issue is that this results in PAR2 renaming the file back to the temporary name - although the additional steps are a pain.

C:\DOS>PAR2 c -s204800 -r10 -- Ctmp7!1!5.wv
par2cmdline version 0.4, Copyright © 2003 Peter Brian Clements.

par2cmdline comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See COPYING for details.

Block size: 204800
Source file count: 1
Source block count: 124
Redundancy: 10%
Recovery block count: 12
Recovery file count: 4

Opening: Ctmp7!1!5.wv
Computing Reed Solomon matrix.
Constructing: done.
Wrote 2457600 bytes to disk
Writing recovery packets
Writing verification packets
Done

C:\DOS>PAR2 v Ctmp7!1!5.wv.par2 CDImage.wv
par2cmdline version 0.4, Copyright © 2003 Peter Brian Clements.

par2cmdline comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See COPYING for details.

Loading "Ctmp7!1!5.wv.par2".
Loaded 4 new packets
Loading "Ctmp7!1!5.wv.vol00+1.par2".
Loaded 1 new packets including 1 recovery blocks
Loading "Ctmp7!1!5.wv.vol01+2.par2".
Loaded 2 new packets including 2 recovery blocks
Loading "Ctmp7!1!5.wv.vol03+4.par2".
Loaded 4 new packets including 4 recovery blocks
Loading "Ctmp7!1!5.wv.vol07+5.par2".
Loaded 5 new packets including 5 recovery blocks

There are 1 recoverable files and 0 other files.
The block size used was 204800 bytes.
There are a total of 124 data blocks.
The total size of the data files is 25334898 bytes.

Verifying source files:

Target: "Ctmp7!1!5.wv" - missing.

Scanning extra files:

File: "CDImage.wv" - is a match for "Ctmp7!1!5.wv".

Repair is required.
1 file(s) have the wrong name.
You have 124 out of 124 data blocks available.
You have 12 recovery blocks available.
Repair is possible.
You have an excess of 12 recovery blocks.
None of the recovery blocks will be used for the repair.

C:\DOS>PAR2 r Ctmp7!1!5.wv.par2 CDImage.wv
par2cmdline version 0.4, Copyright © 2003 Peter Brian Clements.

par2cmdline comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See COPYING for details.

Loading "Ctmp7!1!5.wv.par2".
Loaded 4 new packets
Loading "Ctmp7!1!5.wv.vol00+1.par2".
Loaded 1 new packets including 1 recovery blocks
Loading "Ctmp7!1!5.wv.vol01+2.par2".
Loaded 2 new packets including 2 recovery blocks
Loading "Ctmp7!1!5.wv.vol03+4.par2".
Loaded 4 new packets including 4 recovery blocks
Loading "Ctmp7!1!5.wv.vol07+5.par2".
Loaded 5 new packets including 5 recovery blocks

There are 1 recoverable files and 0 other files.
The block size used was 204800 bytes.
There are a total of 124 data blocks.
The total size of the data files is 25334898 bytes.

Verifying source files:

Target: "Ctmp7!1!5.wv" - missing.

Scanning extra files:

File: "CDImage.wv" - is a match for "Ctmp7!1!5.wv".

Repair is required.
1 file(s) have the wrong name.
You have 124 out of 124 data blocks available.
You have 12 recovery blocks available.
Repair is possible.
You have an excess of 12 recovery blocks.
None of the recovery blocks will be used for the repair.


Repair complete.

C:\DOS>PAR2 v Ctmp7!1!5.wv.par2
par2cmdline version 0.4, Copyright © 2003 Peter Brian Clements.

par2cmdline comes with ABSOLUTELY NO WARRANTY.

This is free software, and you are welcome to redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. See COPYING for details.

Loading "Ctmp7!1!5.wv.par2".
Loaded 4 new packets
Loading "Ctmp7!1!5.wv.vol00+1.par2".
Loaded 1 new packets including 1 recovery blocks
Loading "Ctmp7!1!5.wv.vol01+2.par2".
Loaded 2 new packets including 2 recovery blocks
Loading "Ctmp7!1!5.wv.vol03+4.par2".
Loaded 4 new packets including 4 recovery blocks
Loading "Ctmp7!1!5.wv.vol07+5.par2".
Loaded 5 new packets including 5 recovery blocks

There are 1 recoverable files and 0 other files.
The block size used was 204800 bytes.
There are a total of 124 data blocks.
The total size of the data files is 25334898 bytes.

Verifying source files:

Target: "Ctmp7!1!5.wv" - found.

All files are correct, repair is not required.

C:\DOS>dir *.wv
Volume in drive C has no label.
Volume Serial Number is D888-3345

Directory of C:\DOS

06/09/2004 16:07 25,334,898 Ctmp7!1!5.wv
2 File(s) 50,669,796 bytes
0 Dir(s) 219,528,957,952 bytes free


Obviously, now I know that I can't verify before repairing, I could miss out that step - but it does still mean that you have to repair before verifying and your filename will be reverted by PAR2!

So, in conclusion, I will continue to deter people from renaming their files after running PAR2, as it does cause more work.

Update: Also, if your are verifying from a DVD then I don't think this could work, as PAR2 wouldn't be able to rename the file, and therefore it would never be able to verify.

As I stated in the (factually incorrect) post above (which hopefully everyone skipped):

QUOTE
This is the reason my backup system uses two batch files: to get EAC to rename the file from the temporary name to the final name in between the two.  PAR2 then runs in the second (eac-post.bat) referencing the final filename.


Edit: fixed dodgy BB Code and made text dump text smaller
rfarris
QUOTE(menders @ Sep 28 2004, 09:38 AM)
You're right if you're talking about Josh's tools. I'm talking about Case's foobar2000 flac component. It will read the cuesheet from a tag named "CUESHEET". Try it.
*

I stand corrected.

Pardon me if I wasn't paying attention earlier; how do you get the CUESHEET tag embedded in the first place?
Synthetic Soul
QUOTE(rfarris @ Sep 29 2004, 06:25 PM)
Pardon me if I wasn't paying attention earlier; how do you get the CUESHEET tag embedded in the first place?
*

Either:

Copy the text from the cuesheet, go into foobar, select "Properties", add a new metadata field, call it "CUESHEET", and paste the clipboard contents into the textbox.

or:

Use my version of Tag, and do:

CODE
TAG.EXE -f "CUESHEET=E:\CDBackup\CDImage.flac.cue" "E:\CDBackup\CDImage.flac.flac"


I've been waiting to say that for so long... biggrin.gif
Edit 2005-01-13: Updated URL to blueyonder address/cd_backup.html[/url]
rfarris
QUOTE(Synthetic Soul @ Sep 29 2004, 11:48 AM)
QUOTE(rfarris @ Sep 29 2004, 06:25 PM)
Pardon me if I wasn't paying attention earlier; how do you get the CUESHEET tag embedded in the first place?
*

Either:
...
or:

Use my version of Tag, and do:

CODE
TAG.EXE -f "CUESHEET=E:\CDBackup\CDImage.flac.cue" "E:\CDBackup\CDImage.flac.flac"

*


Thanks, Synth. I wish there was a way to get EAC to do it automatically.

Actually, the position I'm in now is that I have a directory tree with individual flacs in it, and another directory tree with wav and cue files. So I suppose I wish that Flac Frontend would do it, too. Does Flac Frontend call tag.exe?
Synthetic Soul
QUOTE(rfarris @ Sep 30 2004, 06:12 PM)
Thanks, Synth.  I wish there was a way to get EAC to do it automatically.
*

I get EAC to do it "automatically" using batch files, as per my guide.

If you're interested I could adapt eac-enc.bat to simply encode to FLAC and then embed the cuesheet (you wouldn't need eac-post.bat).

Update: Actually, you may be happier using a well-known tool like MAREO. Your INI file would then have something like:

CODE
; =========================================================
;  FLAC
; =========================================================
EXT = flac
PATH = NONE
ENCODER = "C:\Program Files\Flac\FLAC.EXE"
PARAMETERS = -8 -o "@dest@" -V "@source@"

; =========================================================
;  TAG
; =========================================================
EXT = NONE
PATH = NONE
ENCODER = C:\DOS\TAG.EXE
PARAMETERS = --artist "@artist@" --album "@album@" -f "CUESHEET=@tmppathonly@\@finalnameonly@.cue" "@tmppathonly@\@tmpnameonly@.flac"

If you were using a format that supported APEv2 tags (this is more aimed at other interested parties), you could even use Wapet, which I also adapted to use the -f switch, directly from EAC. However, this would give you less flexibility, as you would have to hardcode where to find the cuesheet. The batch file/MAREO approach lets you change the folder and name of the image without having to adapt the command line (as it uses @tmppathonly@ and @finalnameonly@ to generate the path dynamically).

QUOTE(rfarris @ Sep 30 2004, 06:12 PM)
Actually, the position I'm in now is that I have a directory tree with individual flacs in it, and another directory tree with wav and cue files.  So I suppose I wish that Flac Frontend would do it, too.  Does Flac Frontend call tag.exe?
*

Yes, it does - I just tested it.

Edit 2005-01-13: Updated URL to blueyonder address/cd_backup.html[/url]
rfarris
You've done some good work here, Synth. It's just that I'm scared of getting too many tools in the toolchain. I know from experience that I'll set these archives aside for 1, or 2, or 5 years and then when it's time to un-archive them either the tools won't be available any more, or I'll have forgotten how to use them. :-)
Synthetic Soul
Thanks for the compliment.

Whether you decide to use it or not, at least you know now you have options, if circumstances change.
TwoJ
QUOTE
If you're interested I could adapt eac-enc.bat to simply encode to FLAC and then embed the cuesheet (you wouldn't need eac-post.bat).


Synth, I would be interested in a version made for FLAC biggrin.gif
I started out with ape & then switched to Flac, I can appreciate your reasons for using it.

What I would really like - almost the holy grail - is to have it rip as CD image (ape, flac) seperate & embedded cue, tags, etc, PLUS to produce a secondary folder with mp3/mpc/ogg with tags etc. kind of a merger between your batch file and mario. What do you think?
Synthetic Soul
QUOTE(TwoJ @ Oct 2 2004, 06:16 PM)
Synth, I would be interested in a version made for FLAC  biggrin.gif
*

The code for the batch file is below - save it as eac-flac.cmd. Your EAC command line options would be:

/c C:\dos\eac-flac.cmd %o %s %d "%a" "%g" %hHIGH%h %lLOW%l

However, I would recommend using the MAREO settings I suggested to rfarris, as it will probably be easier to maintain in the long run.

CODE
@ECHO OFF
CLS

REM ===================
REM  Parameter mapping
REM ===================
REM  %o  %s  %d  "%a"  "%g"  %hHIGH%h  %lLOW%l
REM  %1  %2  %3   %4    %5   %6        %6

REM =====================================================
REM  PLEASE EDIT THE PATHS TO THE NECESSARY APPLICATIONS
REM =====================================================
SET pathToFlac="C:\Program Files\Flac\FLAC.EXE"
SET pathToTag="C:\DOS\TAG.EXE"

REM ===========================
REM  Write variables to screen
REM ===========================
ECHO EAC-FLAC.CMD
ECHO ============
ECHO.
ECHO Original    (o) : %1
ECHO Source      (s) : %2
ECHO Destination (d) : %3
ECHO CD Artist   (a) : %4
ECHO CD Title    (g) : %5
ECHO.
ECHO FLAC.EXE        : %pathToFlac%
ECHO TAG.EXE         : %pathToTag%

REM =======================
REM  Set compression level
REM =======================
ECHO.
If "%6"=="LOW" CALL :SetLow
If "%6"=="HIGH" CALL :SetHigh

REM =================================
REM  Encode wave file using FLAC.EXE
REM =================================
SET flacCommand=%pathToFlac% %flacCompression% -o %3 -V %2
ECHO.
ECHO CALLING FLAC USING THE FOLLOWING COMMAND:
ECHO %flacCommand%
ECHO ________________________________________________________________________
ECHO.
%flacCommand%

REM =========================================
REM  Add cuesheet to FLAC file using TAG.EXE
REM =========================================
SET tagCommand=%pathToTag% --artist %4 --album %5 -f "CUESHEET=%~dp3%~n1.cue" %3
ECHO.
ECHO CALLING TAG USING THE FOLLOWING COMMAND:
ECHO %tagCommand%
ECHO ________________________________________________________________________
ECHO.
%tagCommand%

REM PAUSE

REM =====
REM  END
REM =====
GOTO:EOF

REM ==========================================
REM  SetLow : sets compression rate to normal
REM ==========================================
:SetLow
REM Compression level: Low
ECHO Comression      : Low
SET flacCompression=-5
GOTO:EOF

REM =========================================
REM  SetHigh : sets compression rate to high
REM =========================================
:SetHigh
REM Compression level: High
ECHO Comression      : High
SET flacCompression=-8
GOTO:EOF

QUOTE(TwoJ @ Oct 2 2004, 06:16 PM)
What I would really like - almost the holy grail - is to have it rip as CD image (ape, flac) seperate & embedded cue, tags, etc, PLUS to produce a secondary folder with mp3/mpc/ogg with tags etc. kind of a merger between your batch file and mario. What do you think?
*

If you are talking about ripping a CD to one image, and in the same process splitting that image intro tracks and encoding to MP3, MPC and OGG then I'm afraid I don't have a solution.

I have made a suggestion about ripping to one image and then splitting into MP3 using an adapted version of LAME in this thread - but to encode to all three, I would think you would need the following process to occur:
  • EAC writes to WAV file
  • Call to FLAC to encode WAV to FLAC
  • Call to TAG to embed cuesheet in FLAC file
  • Call to APPLICATION-X to split WAV file into separate track WAVs using the cuesheet
  • Iterate through all new WAVs and encode using LAME
  • Iterate through all new WAVs and encode using MPPENC
  • Iterate through all new WAVs and encode using OGGENC
  • Clean up track WAV files
Unfortunately, I don't know of a command line tool that will split a WAV into parts using a cuesheet - although I expect there is one somewhere...

If someone can let me know about a command line application to split a WAV file using a cuesheet then I could do the rest. I'd be quite interested in seeing this process in action.
tev777
QUOTE(Synthetic Soul @ Oct 2 2004, 10:28 AM)
[*]Call to APPLICATION-X to split WAV file into separate track WAVs using the cuesheet


There is a program called shntool that will do this. http://shnutils.freeshell.org/ It also works directly on FLAC and other encoded files.
Synthetic Soul
QUOTE(tev777 @ Oct 2 2004, 07:35 PM)
There is a program called shntool that will do this. http://shnutils.freeshell.org/ It also works directly on FLAC and other encoded files.
*

Thanks tev777.

I checked out shntool. Unfortunately it made me realise that there is another aspect that I hadn't considered.

We could use shntool to create track WAV files, but we would have no track information about those files, therefore tagging would be impossible.

I know TwoJ mentioned tagging, and I think anyone would want to tag the track files (MP3s, MPCs, OGGs, etc.) as part of the same process.

The only way I can see to get a round this would be to introduce yet another application, possibly two.

Shntool can't use a cuesheet unless the first line contains the "FILE" keyword, which rules out using a cuesheet with PERFORMER/TITLE information. However, if we want to tag our track files the PERFORMER/TITLE information in the cuesheet is our only possible source. Therefore, the process would have to be something like:
  • Take the cuesheet with PERFORMER/TITLE information generated by EAC, and create a new one with only FILE, TRACK and INDEX 01 info (APP-X)
  • Split the image WAV into track WAVs using shntool and the new cuesheet.
  • Encode track WAVs into all required formats
  • Grab the Artist/Album/Track info from the original cuesheet and use TAG to add tags to the compressed files, and rename them (APP-X > TAG)
This is quite interesting as a problem-solving excercise - but I think we (me?) are just getting overly-complicated now...
ponchorage
Flac 1.1.1 has a new decoding option:

http://flac.sourceforge.net/documentation....ecoding_options

It allows you to use a cuesheet to decode certain parts of the image file. This could probably be used to help accomplish what we want: a flac image and individual lossy files. I'm going to start working on this soon. I guess you'd have to cycle through the cue file and somehow find the correct track index ranges for each individual song. Does that make sense? Could this be done?
Synthetic Soul
Sounds useful.

So we need an app that will parse the cuesheet, track by track, passing the information first to FLAC, and then to X number of encoders, and most likely tag.

Certainly sounds achievable.

The app should look to the "FILE" command in the cuesheet to ascertain what FLAC file to split. It should look for the occurance of "TITLE" not within a track for the album name. It should use the "PERFORMER" and "TITLE" values within each track for the artist and track names, and the track number itself for the... err... track number.

Perhaps the easiest way for it to perform the encoding would be to call MAREO, passing it the required parameter signature. Either that, or it has to have some sort of INI support as per MAREO, to allow users to specify what encoders to use.

If you are saying that you're up for the challenge then that's cool. Put me down as a beta tester please.
ponchorage
OK! I've got a demo working!!! What this program (I call it flacattack) does is, using EAC:

1. rips an image file
2. creates a new folder named "Artist - Album"
3. renames the cue to "Artist - Album.cue"
4. moves the cue file to "Artist - Album"
5. fixes the file pointer in the cue file (so that it points to "Artist - Album.flac")
6. encodes and tags the image with flac (w/ embedded cue sheet)
7. renames the image file to "Artist - Album.flac"
8. moves the flac image to the new folder
9. renames the log file to "Artist - Album.log"
10. moves the log file to the new folder
11. rips individual mp3s using the embedded cue sheet in the flac file

Steps 1 - 10 will also work for individual files (assuming you manually create the cue sheet - EAC Noncompliant - before ripping and encoding the files)

a typical EAC command line would be:

/c C:\flac\flacattack\flacattack.exe "C:\eac\flac.exe" %s "5" "%a" "%t" "%g" "%y" "%n" "%m" "_" "C:\eac\lame.exe" "y"

you need:

1. /c
2. location of flacattack executable (I would definitely try this with a path with NO spaces)
3. location of flac executable
4. %s (source - no quotes)
5. "5" (this is the compression of the flac file and can be 0 - 8)
6. "%a" (artist - yes quotes)
7. "%t" (title - yes quotes)
8. "%g" (album - yes quotes)
9. "%y" (date - yes quotes)
10. "%n" (tracknumber - yes quotes)
11. "%m" (genre - yes quotes)
12. "_" (this is to replace illegal characters that may appear in artist/album/track names, it can be any legal character)
13. location of lame executable
14. "y" (whether or not to move the log file - can be "y" or "n" - yes quotes)

I recommend copying this command line exactly and then changing only the location of the flacattack, flac, and lame executables

This is kind of cumbersome right now, but gives you some options. I hope to fix this soon. There is some help in the readme.txt file but it is incomplete.

You can download the files at http://www.uninformative.com/flacattack.zip. You need the newest version of Flac - 1.1.1. Feel free to post here or send me an email with questons/suggestions.
Synthetic Soul
That's cool. I hope to experiment with that sometime this evening.

I'll let you know if I have any queries/suggestions.

Now you have done much of the groundwork, how hard do you think it would be to get it to be able to encode to other encoders, in addition to, or instead of, LAME? It seems to me that you've done most of the hard work (i.e.: parsing the cuesheet and extracting the info).

I'm sure TwoJ would be your best friend wink.gif


I guess I'll find out tonight, but I'm intruiged: are you creating temporaray WAV files to pass to LAME, or some other method?
ponchorage
It would be quite easy to get it working with multiple encoders.

No temporary waves. I'm just decoding the flac portion of the image for each song to stdout and then piping that to lame to encode.

TwoJ: I hope you find this useful.

The one main problem I'm having right now is an ever-growing command line. Like I said, it is cumbersome and not very flexible right now. I'd like to be able to add (and will) lame/mpc/ogg encoder options. Right now it is just set to encode Lame APS.
TwoJ
ponchorage - my new best friend! biggrin.gif

ok - just downloaded the zip - and I will try it tonight when I get home.

But I don't see the source file (flacattack.php)? Also can you tell me what the individual file are for, ie the .ini file? It would be great to be able to include switches for aps, apx, etc

I've been waiting over a year to be able to do this in 1 shot. Now I just need to learn some PHP!

Many Many Many Thanks!!
Synthetic Soul
QUOTE(ponchorage @ Oct 4 2004, 02:34 PM)
It would be quite easy to get it working with multiple encoders.
*
Cool.

QUOTE(ponchorage @ Oct 4 2004, 02:34 PM)
No temporary waves. I'm just decoding the flac portion of the image for each song to stdout and then piping that to lame to encode.
*
Cool.

QUOTE(ponchorage @ Oct 4 2004, 02:34 PM)
The one main problem I'm having right now is an ever-growing command line. Like I said, it is cumbersome and not very flexible right now. I'd like to be able to add (and will) lame/mpc/ogg encoder options. Right now it is just set to encode Lame APS.
*
This is why I think an INI/config file is inevitable. If you just pass the location of the config file rather than the path to LAME the config file can worry about all the encoder stuff.

It would probably make sense to use the MAREO format as well (i.e.: EXT, PATH, ENCODER, PARAMETERS) - so that users could port their MAREO INI files across, with no editing!
Synthetic Soul
QUOTE(TwoJ @ Oct 4 2004, 03:58 PM)
But I don't see the source file (flacattack.php)? Also can you tell me what the individual file are for, ie the .ini file? It would be great to be able to include switches for aps, apx, etc
*
Yeah, I would like to see the source.

I assume the INI file is used by the PHP-executing DLLs - not flacattack.exe.
ponchorage
I'm working on an updated version that will allow for mp3, mpc, and ogg.

Sorry I forgot to include the source. I'll put that in the updated version later today.

Synthetic Soul is correct. The ini is used by the PHP-executing DLLs.
rfarris
Just one question, Ponchorage, when you say that you embed the cue sheet in the flac file, do you mean that you use the flac meta-data cue interface, or that you embed the cue sheet in the ogg-comment area as a CUESHEET tag?
ponchorage
I use the --cuesheet tag that points to an external cue. (flac metadata cue interface)
rfarris
QUOTE(ponchorage @ Oct 4 2004, 05:39 PM)
I use the --cuesheet tag that points to an external cue. (flac metadata cue interface)
*


So no track titles or other metadata, then. Have you considered using the technique described earlier in this thread (I think) where you just import the external cue file text into a "CUESHEET" tag?
ponchorage
QUOTE(rfarris @ Oct 5 2004, 10:21 AM)
QUOTE(ponchorage @ Oct 4 2004, 05:39 PM)
I use the --cuesheet tag that points to an external cue. (flac metadata cue interface)
*


So no track titles or other metadata, then. Have you considered using the technique described earlier in this thread (I think) where you just import the external cue file text into a "CUESHEET" tag?
*



I never found a need to do that. All the files I create have tags that include:

Tracknumber
Artist
Title
Album
Year
Genre

What else do I need? or am I missing something here? What's the point of importing the cue into its own tag? I've wondered about this before.
VILLA21
I just copy and paste the command line from your above post to EAC...but FLAC.exe is never executed. I got only the wav image. Missing something?
ponchorage
QUOTE(VILLA21 @ Oct 5 2004, 01:57 PM)
I just copy and paste the command line from your above post to EAC...but FLAC.exe is never executed. I got only the wav image. Missing something?
*



Could you give some more details? Have you read the "readme.txt" file?
ponchorage
I've released the next version of Flacattack. It adds:

1. Ability to encode to a combination of mp3, mpc, and ogg (after encoding flac image).
2. Add encoder options for mp3, mpc, and ogg.
3. Maybe some other stuff I can't remember.

Check out this thread:

New Thread
Synthetic Soul
QUOTE(ponchorage @ Oct 5 2004, 07:44 PM)
QUOTE(rfarris @ Oct 5 2004, 10:21 AM)
QUOTE(ponchorage @ Oct 4 2004, 05:39 PM)
I use the --cuesheet tag that points to an external cue. (flac metadata cue interface)
*
So no track titles or other metadata, then. Have you considered using the technique described earlier in this thread (I think) where you just import the external cue file text into a "CUESHEET" tag?
*
I never found a need to do that. All the files I create have tags that include:

Tracknumber
Artist
Title
Album
Year
Genre

What else do I need? or am I missing something here? What's the point of importing the cue into its own tag? I've wondered about this before.
*
If you rip a full CD to one image file in EAC the only way to store individual track information is in the cuesheet - which in FLAC will have to be a VORBIS COMMENT called CUESHEET (as rfarris suggested). As far as I am aware EAC will not give access to all the track titles using the %t parameter.

If you rip to separate tracks then you can use the track's TITLE tag (and the %t parameter).

This embedded cuesheet comes in most useful when using whole album files in foobar, where it can use the embedded cuesheet to "split" the file into tracks, so you can skip between then (if you are feeling camp). You get this functionality with an external cuesheet also - but you won't if you don't have either - and some might say that it's easier to work with one file than worry about keeping two together at all times.
ponchorage
QUOTE(Synthetic Soul @ Oct 6 2004, 12:06 AM)
QUOTE(ponchorage @ Oct 5 2004, 07:44 PM)
QUOTE(rfarris @ Oct 5 2004, 10:21 AM)
QUOTE(ponchorage @ Oct 4 2004, 05:39 PM)
I use the --cuesheet tag that points to an external cue. (flac metadata cue interface)
*
So no track titles or other metadata, then. Have you considered using the technique described earlier in this thread (I think) where you just import the external cue file text into a "CUESHEET" tag?
*
I never found a need to do that. All the files I create have tags that include:

Tracknumber
Artist
Title
Album
Year
Genre

What else do I need? or am I missing something here? What's the point of importing the cue into its own tag? I've wondered about this before.
*
If you rip a full CD to one image file in EAC the only way to store individual track information is in the cuesheet - which in FLAC will have to be a VORBIS COMMENT called CUESHEET (as rfarris suggested). As far as I am aware EAC will not give access to all the track titles using the %t parameter.

If you rip to separate tracks then you can use the track's TITLE tag (and the %t parameter).

This embedded cuesheet comes in most useful when using whole album files in foobar, where it can use the embedded cuesheet to "split" the file into tracks, so you can skip between then (if you are feeling camp). You get this functionality with an external cuesheet also - but you won't if you don't have either - and some might say that it's easier to work with one file than worry about keeping two together at all times.
*



So, basically having one file instead of two. Okay. Thanks.
rfarris
QUOTE(ponchorage @ Oct 5 2004, 11:44 AM)
All the files I create have tags that include:

Tracknumber
Artist
Title
Album
Year
Genre

What else do I need? or am I missing something here? What's the point of importing the cue into its own tag? I've wondered about this before.
*


That's what you'd think, wouldn't you? Tell ya what, use metaflac to extract one of those cue sheets that you embedded and post it here, ok?
ponchorage
QUOTE(rfarris @ Oct 6 2004, 10:38 AM)
QUOTE(ponchorage @ Oct 5 2004, 11:44 AM)
All the files I create have tags that include:

Tracknumber
Artist
Title
Album
Year
Genre

What else do I need? or am I missing something here? What's the point of importing the cue into its own tag? I've wondered about this before.
*


That's what you'd think, wouldn't you? Tell ya what, use metaflac to extract one of those cue sheets that you embedded and post it here, ok?
*



Here's a screenshot from Foobar. It looks like using --cuesheet when encoding adds the cuesheet tag. Am I confused?

user posted image

The date and genre are missing because they didn't download from freedb and I didn't fill them in.
ponchorage
Okay, I think I get it. This embedded cue sheet doesn't save the titles. Well, just one title, and it puts it in there for each song.

However, I always create the external cue so this isn't a big deal for me. If you just want the one file, I can see why adding the custom cuesheet tag would be necessary.

My individual flacs do contain all of the information I posted above though.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.