I have a batch file that will scale flac files according to rg album gain when encoding to lame while preserving tag information:
CODE
@ECHO OFF
IF "%~1" == "" lame --help && GOTO end
SET PARAMS=-V3 --noreplaygain --silent
:encode
TITLE Encoding "%~nx1"
IF EXIST "%TEMP%\%~n1.tag" GOTO encode_shift
IF EXIST "%~dpn1.mp3" GOTO encode_shift
SET /p nul=Encoding "%~nx1" <nul
IF /i "%~x1" == ".flac" (
CALL :encode_flac %1
) ELSE ECHO ... Invalid file && GOTO encode_shift
ECHO Done
:encode_shift
SHIFT
IF "%~1" EQU "" ECHO. && TITLE Finished && GOTO end
GOTO encode
:encode_flac
CALL :taginfo %1
SET /p nul=... <nul
flac -dcs %1 | Lame %PARAMS% %TAGINFO% - "%~dpn1.mp3"
GOTO :eof
:taginfo
tag %1 2> "%TEMP%\%~n1.tag"
SET gain=
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Title:" "%TEMP%\%~n1.tag"`) DO (
SET title=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Artist:" "%TEMP%\%~n1.tag"`) DO (
SET artist=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Album:" "%TEMP%\%~n1.tag"`) DO (
SET album=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Year:" "%TEMP%\%~n1.tag"`) DO (
SET year=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Track:" "%TEMP%\%~n1.tag"`) DO (
SET track=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Genre:" "%TEMP%\%~n1.tag"`) DO (
SET genre=%%Y
)
FOR /F "usebackq tokens=1*" %%X IN (`findstr "Comment:" "%TEMP%\%~n1.tag"`) DO (
SET comment=%%Y
)
SET TAGINFO=--add-id3v2 --tt "%title%" --ta "%artist%" --tl "%album%" --ty "%year%" --tn "%track%" --tg "%genre%" --tc "%comment%"
FOR /F "usebackq tokens=1,2* delims== " %%X IN (`FINDSTR /I "replaygain_album_gain" "%TEMP%\%~n1.tag"`) DO (
SET gain=%%Y
)
IF DEFINED gain FOR /F %%X IN ('EVAL 10^^^^^(^(%gain%+3^)/20^)') DO SET TAGINFO=--scale %%X %TAGINFO%
DEL "%TEMP%\%~n1.tag"
GOTO :eof
:end
pause
Refer to this similar post for neroaacenc for links to supporting programs:
http://www.hydrogenaudio.org/forums/index....st&p=580029Because the line out on my ipod is anemic, I've bumped the RG reference by3 dB.
If you want to convert RG values to Sound Check values, look into mp3tag. If you're going to scale your files, Sound Check won't be necessary.
If you scale your files with album gain like above, you have the option to use Sound Check to give you track gain. I hope my edit has made this more clear.