REACT:Adding Support For TAK

From Hydrogenaudio Knowledgebase
Jump to: navigation, search

To configure REACT to use an encoder that is not supported with the original INI and CFG files you will need to make changes to both the INI and CFG file you require.

Below you will find additional text that you will need to add to your config files to use TAK with REACT. This is meant as an example, to demonstrate what is required to add any codec that you choose. The naming schemes and meta data used are based on the examples in the initial INI and CFG files; you may want to change them to fit your methodology.

REACT.ini[edit]

Settings[edit]

Specify that we want to use TAK as our image format.

ImageExt=tak

UserTrackFormats[edit]

Specify that we want to encode tracks using TAK.

Tak=1

UserOutputNames[edit]

Specify the directories for TAK images and tracks.

ImageDir_Tak=@OutRoot@\TAK-images\$cdartist$
TrackDir_Tak=@OutRoot@\TAK\$cdartist$\[$year$] $album$

UserSettings[edit]

Specify any encoding options and the version used.

Opt_Tak=-pN -overwrite
Ver_Tak=1.0.1


REACT-image.cfg[edit]

REM ** Transfer RG values from Wavgain calculations, instead of recalculation.[edit]

Add the text below under the comment above, with the other similar lines.

SET RG_Tak=-t "replaygain_album_gain=%album_gain% dB" -t "replaygain_album_peak=%album_peak%"
SET RG_Tak_acdir=-t $qreplaygain_album_gain=%album_gain% dB$q -t $qreplaygain_album_peak=%album_peak%$q

REM ---- Image ----[edit]

Add the text below under the comment above, with the other similar lines.

As TAK does not yet support inline tagging this section uses takc.exe to encode, and then tag.exe to add APEv2 tags to the newly-created TAK file. You will need to add takc.exe and tag.exe (version 2.0.49 or above) to your REACT tools directory.

IF NOT @ImageExt@==tak GOTO end_tak_image
	SET dest="@ImageDir_Tak@"
	IF NOT EXIST %dest% MKDIR %dest%
	@tools@\takc.exe -e @Opt_Tak@ "@source@" "@image@"
	@tools@\tag.exe %RG_Tak% -t "%ArtistField%=@cdartist@" -t album="@album@" -t totaltracks="@numtracks@" -t year="@year@" -t genre="@genre@" -t comment="@comment@" -t encodedby="%USERNAME%" -t encodersettings="TAK @Ver_Tak@ @Opt_Tak@" -f cuesheet="@cuesheet@" -f eaclog="@eaclog@" "@image@"
	MOVE /Y "@image@" %dest%
	MOVE /Y "@cuesheet@" %dest%
	IF %have_cover%==1 COPY /Y "@cover@" %dest%\"@basename@.jpg"
:end_tak_image

REM ---- Tracks ----[edit]

Add the text below under the comment above, with the other similar lines.

This section uses ACDIR to create TAK track files. It is complicated by the fact that TAK does not yet support piping, or inline tagging. The section uses ACDIR to first split the image WAVE into tracks WAVEs, and then uses ACDIR again to execute mutiple commands for each track, these being:

  1. Use takc.exe to encode the relevant track WAVE.
  2. Use tag.exe to add APEv2 tags to the TAK file.
  3. Delete the WAVE file.
IF NOT @Tak@==1 GOTO end_tak_tracks
	SET dest="@TrackDir_Tak@"
	IF NOT EXIST %dest% MKDIR %dest%
	PUSHD %dest%
		IF @various@==1 SET VA_tag=-t $qalbum artist=@VA@$q
		@tools@\acdir.exe --overwrite --output "%TrackName%.wav" --extract "@sourcecuesheet@"
		@tools@\acdir.exe --exec "@tools@\takc.exe -e -overwrite @Opt_Tak@ $q%TrackName%.wav$q $q%TrackName%.tak$q && @tools@\tag.exe %RG_Tak_acdir% %VA_tag% -t artist=$#a -t album=$#T -t title=$#t -t track=$n/$N -t year=$q@year@$q -t genre=$q@genre@$q -t comment=$q@comment@$q -t encodedby=$q%USERNAME%$q -t encodersettings=$qTAK @Ver_Tak@ @Opt_Tak@$q $q%TrackName%.tak$q && DEL $q%TrackName%.wav$q" "@sourcecuesheet@"
		COPY /Y "@eaclog@" "EAClog.txt"
		IF %have_cover%==1 COPY /Y "@cover@" "folder.jpg"
		IF EXIST "@albumfile@.[*].cue" COPY /Y "@albumfile@.[*].cue" .
	POPD
:end_tak_tracks


REACT-track.cfg[edit]

REM ============== Begin Main Script ==================[edit]

Add the text below under the comment above, with the other similar lines.

SET TrackDir_Tak="@TrackDir_Tak@"

REM ---- Track ----[edit]

Add the text below under the comment above, with the other similar lines.

As TAK does not yet support inline tagging this section uses takc.exe to encode, and then tag.exe to add APEv2 tags to the newly-created TAK file. You will need to add takc.exe and tag.exe (version 2.0.49 or above) to your REACT tools directory.

IF NOT @Tak@==1 GOTO end_tak_tracks
	IF NOT EXIST %TrackDir_Tak% MKDIR %TrackDir_Tak%
	PUSHD %TrackDir_Tak%
		IF @various@==1 SET VA_tag=-t "album artist=@VA@"
		ECHO ON
		@tools@\takc.exe -e -overwrite @Opt_Tak@ "@source@" "%TrackName%.tak"
		@tools@\tag.exe %VA_tag% -t artist="@artist@" -t album="@album@" -t track="@track@/@numtracks@" -t title="@title@" -t year="@year@" -t genre="@genre@" -t comment="@comment@" -t encodedby="%USERNAME%" -t encodersettings="TAK @Ver_Tak@ @Opt_Tak@" "%TrackName%.tak"
		@ECHO OFF
		IF %have_cover%==1 IF NOT EXIST folder.jpg COPY "@cover@" folder.jpg
		TITLE @track@/@numtracks@ - "@album@"
	POPD
:end_tak_tracks


Related Thread[edit]

This tip is a result of a the discussion in the thread TAK(ing) with EAC.


See Also[edit]


External Links[edit]