Help - Search - Members - Calendar
Full Version: Replay Gain not working with REACT
Hydrogenaudio Forums > CD-R and Audio Hardware > CD Hardware/Software
RBI Champ
Hi, I'm having what I hope is a simple problem. Neither ReplayGain or AlbumGain are being set on my flac files. It looks as if it has done something, but foobar doesn't show any gain values when I view the flac file's properties.

What I think is the relevant code is below. One minor thing to note (as can be seen below) I've renamed update-cuesheet.bat to update-cueslogs.bat. (This was done for my own clarification; I have it make changes to both my cuesheet and eac log).

Thanks in advance for any suggestions.

CODE

From react.ini

ReplayGain=1
ApplyAlbumGain=1
AdjustAlbumGain_dB=+3.0

From react-track.cfg

    IF @Flac@==1 (
        PUSHD %TrackDir_Flac%
            IF %add_rg%==1 @tools@\Glob.exe -v -c @tools@\metaflac.exe %RG_MetaFlac% *.flac
            @tools@\GSAR.EXE -s%% -r%%%% -o update-cueslogs.bat
            CALL update-cueslogs.bat
            DEL update-cueslogs.bat
            COPY /Y "@eaclog@" "$cdartist$ - $album$.log."
        POPD
    )


From a captured log file I created during processing

C:\Music\Lossless\My Bloody Valentine\Tremolo EP>ECHO C:\PROGRA~1\FLAC\GSAR.EXE
"-sK::\Working\My Bloody Valentine - Tremolo EP - 04 - Moon Song.wav" "-r"""Moon
Song.flac"""" -o "C:\Working\My Bloody Valentine - Tremolo EP.log" 1>>update-cu
eslogs.bat
C:/PROGRA~1/FLAC/metaflac.exe
--add-replay-gain
Honey Power.flac
Moon Song.flac
Swallow.flac
To Here Knows When.flac
Akkurat
QUOTE(RBI Champ @ Jun 29 2008, 07:47) *
Hi, I'm having what I hope is a simple problem. Neither ReplayGain or AlbumGain are being set on my flac files. It looks as if it has done something, but foobar doesn't show any gain values when I view the flac file's properties.

Maybe there's a bug in the foobar? I replied to same question back in February.. and IIRC, never got any response from the other user. Maybe you could try it. Also if you have any other tools/programs (mp3tag, winamp, etc.) which can read the tags, please do try them also.

P.S. You can use CODEBOX tags to wrap long code listings.. if you didn't know.

EDIT: corrected the link
RBI Champ
QUOTE(Akkurat @ Jun 29 2008, 05:32) *

Maybe there's a bug in the foobar? I replied to same question back in February.. and IIRC, never got any response from the other user. Maybe you could try it. Also if you have any other tools/programs (mp3tag, winamp, etc.) which can read the tags, please do try them also.


Akkurat, thanks for your help. Below is the results of "metaflac --list." There are no "comment" lines about replay/album gain. I should mention that the lack of replay/album gain has occurred for every single flac file I've produced through REACT/EAC these last 3+ months. I didn't realize the "comment" tags were missing until this weekend. I've been concentrating too much on extracting rather than detailed listening. smile.gif

I've now ran the same command on a completely different flac file that manually had replay gain added via foobar. It has "Comments" of "replaygain_album_gain=-4.93 dB," "replaygain_album_peak=0.967529," "replaygain_track_gain=-5.58 dB," and "replaygain_track_peak=0.967529." I would have expected to see those on the flac file shown below.

QUOTE

P.S. You can use CODEBOX tags to wrap long code listings.. if you didn't know.


Are there different "codebox" tags than what I am using? When I copy and paste from my script window, that is exactly how it appears, in terms of the line wrapping. I was trying not to alter what I see on my screen in case there was a syntax error.

CODE

metaflac --list "To Here Knows When.flac"
METADATA block #0
  type: 0 (STREAMINFO)
  is last: false
  length: 34
  minimum blocksize: 4096 samples
  maximum blocksize: 4096 samples
  minimum framesize: 14 bytes
  maximum framesize: 11610 bytes
  sample_rate: 44100 Hz
  channels: 2
  bits-per-sample: 16
  total samples: 15404424
  MD5 signature: 9b781211d8dda10a11205b18b585dbdf
METADATA block #1
  type: 3 (SEEKTABLE)
  is last: false
  length: 630
  seek points: 35
    point 0: sample_number=0, stream_offset=0, frame_samples=4096
    point 1: sample_number=438272, stream_offset=1044469, frame_samples=4096
    point 2: sample_number=880640, stream_offset=2139138, frame_samples=4096
    point 3: sample_number=1318912, stream_offset=3240111, frame_samples=4096
    point 4: sample_number=1761280, stream_offset=4344615, frame_samples=4096
    point 5: sample_number=2203648, stream_offset=5479015, frame_samples=4096
    point 6: sample_number=2641920, stream_offset=6587450, frame_samples=4096
    point 7: sample_number=3084288, stream_offset=7752211, frame_samples=4096
    point 8: sample_number=3526656, stream_offset=8913647, frame_samples=4096
    point 9: sample_number=3964928, stream_offset=10002455, frame_samples=4096
    point 10: sample_number=4407296, stream_offset=11116986, frame_samples=4096
    point 11: sample_number=4849664, stream_offset=12238365, frame_samples=4096
    point 12: sample_number=5287936, stream_offset=13371501, frame_samples=4096
    point 13: sample_number=5730304, stream_offset=14506134, frame_samples=4096
    point 14: sample_number=6172672, stream_offset=15674097, frame_samples=4096
    point 15: sample_number=6610944, stream_offset=16835719, frame_samples=4096
    point 16: sample_number=7053312, stream_offset=18013314, frame_samples=4096
    point 17: sample_number=7495680, stream_offset=19186579, frame_samples=4096
    point 18: sample_number=7933952, stream_offset=20312073, frame_samples=4096
    point 19: sample_number=8376320, stream_offset=21456886, frame_samples=4096
    point 20: sample_number=8818688, stream_offset=22638594, frame_samples=4096
    point 21: sample_number=9256960, stream_offset=23804437, frame_samples=4096
    point 22: sample_number=9699328, stream_offset=24944533, frame_samples=4096
    point 23: sample_number=10141696, stream_offset=26088643, frame_samples=4096
    point 24: sample_number=10579968, stream_offset=27220458, frame_samples=4096
    point 25: sample_number=11022336, stream_offset=28361730, frame_samples=4096
    point 26: sample_number=11464704, stream_offset=29506672, frame_samples=4096
    point 27: sample_number=11902976, stream_offset=30638317, frame_samples=4096
    point 28: sample_number=12345344, stream_offset=31672508, frame_samples=4096
    point 29: sample_number=12787712, stream_offset=32565328, frame_samples=4096
    point 30: sample_number=13225984, stream_offset=33367066, frame_samples=4096
    point 31: sample_number=13668352, stream_offset=34132283, frame_samples=4096
    point 32: sample_number=14110720, stream_offset=34890416, frame_samples=4096
    point 33: sample_number=14548992, stream_offset=35642026, frame_samples=4096
    point 34: sample_number=14991360, stream_offset=36400405, frame_samples=4096

METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 294
  vendor string: reference libFLAC 1.2.1 20070917
  comments: 10
    comment[0]: artist=My Bloody Valentine
    comment[1]: album=Tremolo EP
    comment[2]: tracknumber=1
    comment[3]: totaltracks=4
    comment[4]: title=To Here Knows When
    comment[5]: date=1991
    comment[6]: genre=Shoegazing
    comment[7]: comment=Created with EAC/REACT2, 2008-06-28
    comment[8]: encoded-by=username
    comment[9]: encoding=Flac 1.2.1 -8 -f -V
METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 8192

Akkurat
QUOTE(RBI Champ @ Jun 29 2008, 15:10) *
Akkurat, thanks for your help. Below is the results of "metaflac --list." There are no "comment" lines about replay/album gain. I should mention that the lack of replay/album gain has occurred for every single flac file I've produced through REACT/EAC these last 3+ months. I didn't realize the "comment" tags were missing until this weekend. I've been concentrating too much on extracting rather than detailed listening. smile.gif

Is your metaflac.exe & glob.exe files in the REACT tools folder? Can you put the Debug=1 in INI file and watch the dos prompt window when you rip a CD? Does it give any error messages when it's supposed to run the metaflac? I would like to guess that the actual RG calculating is not working ok in your setup right now. You can also test using metaflac.exe by hand to calculate one flac file (w/o RG tags) and then checking it with the "-- list" command again.

QUOTE(RBI Champ @ Jun 29 2008, 15:10) *
Are there different "codebox" tags than what I am using?

Yes. Just change the CODE tags to CODEBOX tags. This forum software doesn't show this option in the post page tools.. which is stupid since moderators have to edit posts & we old time geezers (well, not newbies smile.gif) have to hint this to new users all the time (I haven't been around long though).

Here's my (block 2) list for comparison from one flac file (from a very recent rare acquisition; I watched this rare Japan release for about a year in eBay (one slipped thru my fingers because one dutch guy offered lots of dollars for it, but I finally have it, bwahaha wink.gif)
CODE
metaflac.exe" --list --block-number=2 "Kula Shaker - Shower Your Love (CDS) - 01 - Shower Your Love.flac"
METADATA block #2
type: 4 (VORBIS_COMMENT)
is last: false
length: 572
vendor string: reference libFLAC 1.2.1 20070917
comments: 20
comment[0]: artist=Kula Shaker
comment[1]: album=Shower Your Love (CDS)
comment[2]: tracknumber=01/05
comment[3]: discnumber=1
comment[4]: totaldiscs=1
comment[5]: discname=
comment[6]: title=Shower Your Love
comment[7]: date=1999
comment[8]: genre=Rock
comment[9]: freedbid=3103F905
comment[10]: comment=
comment[11]: ripper=EAC v0.99pb4 / REACT 2.0.akku.b02 (custom)
comment[12]: encoded-by=Akkurat
comment[13]: encoding=flac 1.2.1 ::: -5 -f -w -V
comment[14]: encodingtime=20.06.2008
comment[15]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
comment[16]: REPLAYGAIN_TRACK_GAIN=-6.28 dB
comment[17]: REPLAYGAIN_TRACK_PEAK=0.97091675
comment[18]: REPLAYGAIN_ALBUM_GAIN=-6.53 dB
comment[19]: REPLAYGAIN_ALBUM_PEAK=0.99996948
RBI Champ
QUOTE(Akkurat @ Jun 29 2008, 11:54) *

Is your metaflac.exe & glob.exe files in the REACT tools folder? Can you put the Debug=1 in INI file and watch the dos prompt window when you rip a CD? Does it give any error messages when it's supposed to run the metaflac? I would like to guess that the actual RG calculating is not working ok in your setup right now. You can also test using metaflac.exe by hand to calculate one flac file (w/o RG tags) and then checking it with the "-- list" command again.

all of my react and flac tools are in the same folder "\Program Files\FLAC." I also have that location in my "path" so I can use those commands from other folders etc.

there aren't any errors when I debug, though visually it doesn't look as you might expect with things on separate lines. I did try deleting any extra hard returns or spaces to make sure that it wasn't something like that. Please see the first codebox at the end of my post.

I 've manually ran "metaflac --add-replay-gain" to a flac file. I verified with a "--list" beforehand that it had nothing in it. see the second codebox below.
QUOTE

Yes. Just change the CODE tags to CODEBOX tags. This forum software doesn't show this option in the post page tools.. which is stupid since moderators have to edit posts & we old time geezers (well, not newbies smile.gif) have to hint this to new users all the time (I haven't been around long though).

thanks. below are my first uses of those tags.

ps- congrats on your Kula Shaker rarity!
CODE

C:\Music\Lossless\R.E.M\Out Of Time>ECHO C:\PROGRA~1\FLAC\GSAR.EXE "-sC::\Working\R.E.M. - Out Of Time - 11 - Me In Honey.wav" "-r:034Me In Honey.flac:034" -o "R.E.M - Out Of Time.log" 1>>update-cueslogs.bat
C:/PROGRA~1/FLAC/metaflac.exe
--add-replay-gain
Belong.flac
Country Feedback.flac
Endgame.flac
Half A World Away.flac
Losing My Religion.flac
Low.flac
Me In Honey.flac
Near Wild Heaven.flac
Radio Song.flac
Shiny Happy People.flac
Texarkana.flac

CODE

metaflac.exe --list --block-number=2 "To Here Knows When.flac"
METADATA block #2
type: 4 (VORBIS_COMMENT)
is last: false
length: 475
vendor string: reference libFLAC 1.2.1 20070917
comments: 15
comment[0]: artist=My Bloody Valentine
comment[1]: album=Tremolo EP
comment[2]: tracknumber=1
comment[3]: totaltracks=4
comment[4]: title=To Here Knows When
comment[5]: date=1991
comment[6]: genre=Shoegaze
comment[7]: comment=Created by EAC/REACT2, 2008-06-28
comment[8]: encoded-by=username
comment[9]: encoding=Flac 1.2.1 -8 -f -V
comment[10]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
comment[11]: REPLAYGAIN_TRACK_GAIN=-4.83 dB
comment[12]: REPLAYGAIN_TRACK_PEAK=0.85784912
comment[13]: REPLAYGAIN_ALBUM_GAIN=-4.83 dB
comment[14]: REPLAYGAIN_ALBUM_PEAK=0.85784912
Akkurat
QUOTE(RBI Champ @ Jun 29 2008, 21:22) *
all of my react and flac tools are in the same folder "\Program Files\FLAC." I also have that location in my "path" so I can use those commands from other folders etc.

Wait a minute, you have all in the FLAC directory? Then you must have changed the Tools= setting in the INI? (You have @tools@\Glob.exe -v -c @tools@\metaflac.exe commands in your track cfg)

I may know what's going on, I had problems with Glob.exe running the metaflac.exe when I changed the @tools@\metaflac.exe to "%FlacDir%\metaflac.exe".

Do you get something like this in dos prompt when the Glob->metaflac is supposed to run (it could be hard to detect since the dos prompt flies by quickly -> add a PAUSE command temporarily after the glob/metaflac command to catch it):
CODE
Executing: C:/Program Files/FLAC/metaflac.exe "--add-replay-gain" "Kula Shaker -
Shower Your Love (CDS) - 01 - Shower Your Love.flac" "Kula Shaker - Shower Your
Love (CDS) - 02 - Goodbye Tin Terriers.flac" "Kula Shaker - Shower Your Love (C
DS) - 03 - Sound Of Drums (Live Radio 1 Session).flac" "Kula Shaker - Shower You
r Love (CDS) - 04 - The Dancing Flea (From Jay Darlington Plays, 'The Dancing Fl
ea').flac" "Kula Shaker - Shower Your Love (CDS) - 05 - Light Of The Day.flac"
'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

The command I ran:
CODE
"C:\Program Files\REACT2\tools\Glob.exe" -v -c "C:\Program Files\FLAC\metaflac.exe" --add-replay-gain *.flac

As you can see, the thing is that Glob.exe for some reason tries to run the metaflac without quotes (Executing: C:/Program Files/FLAC/metaflac.exe ...), and that's not going to work since there's a space between Program and Files. It also turns around the backslashes to normal slashes (smells like *nix).. but this is no problem to us, as long as we get rid of the spaces in the directories (i.e. we have to turn it to short path).

I've tested that the @tools@ variable works fine if I haven't changed the Tools= setting in the INI.. what I have NOT tested is that does it work if I change the Tools= setting. Maybe this is the case with you now. My test showed that the @tools@ variable extends to SHORT path if not changed.

And here's the solution to change the long paths to short paths:
CODE
REM ** Convert long path into a short path for Glob tool to function properly.
FOR %%X IN ("@Tools@") DO SET ToolsDirShort=%%~fsX

IF %add_rg%==1 "%ToolsDirShort%\Glob.exe" -v -c "%ToolsDirShort%\metaflac.exe" %RG_MetaFlac% *.flac

I hope I'm on the right track here..
RBI Champ
My react.ini has the following entry for tools:
CODE

Tools=C:\Program Files\FLAC

I added the pause and it looks like this:
CODE

C:/PROGRA~1/FLAC/metaflac.exe
--add-replay-gain
Grievance (Live From Bellingham, WA, May 10, 2000).flac
Light Years.flac
Soon Forget (Live From Bellingham, WA, May 10, 2000).flac

I then tried the new line you suggested and got"
CODE

'"\Glob.exe"' is not recognized as an internal or external command,
operable program or batch file.


Akkurat
QUOTE(RBI Champ @ Jun 30 2008, 05:27) *
I added the pause and it looks like this:
C:/PROGRA~1/FLAC/metaflac.exe
--add-replay-gain
Grievance (Live From Bellingham, WA, May 10, 2000).flac
Light Years.flac
Soon Forget (Live From Bellingham, WA, May 10, 2000).flac

Ok, I was NOT on the right track, I had my doubts, it's not the "short path" thing then. I'm lost here, if the metaflac runs in your REACT rips but files don't have the RG tags, I don't know what to do. And it's established that the metaflac works ok by running it by hand. Have you by any chance read-protected the files before the metaflac.exe starts (perhaps using attrib dos command)? If not, I really don't know what to say. Sorry.

Maybe you could test with the original track cfg & ini files? Or test your configuration in other computer.

P.S. Use CODE tags for short code listings, the CODEBOX is fixed to 10 rows no matter how many lines you have inputted.
RBI Champ
Hi, sorry for the delayed response. I can confirm that my flac files are not in read only state. I have yet to try an original track.cfg or my existing config in another computer. I'll post back when I have done so.


QUOTE(Akkurat @ Jul 1 2008, 06:01) *

Ok, I was NOT on the right track, I had my doubts, it's not the "short path" thing then. I'm lost here, if the metaflac runs in your REACT rips but files don't have the RG tags, I don't know what to do. And it's established that the metaflac works ok by running it by hand. Have you by any chance read-protected the files before the metaflac.exe starts (perhaps using attrib dos command)? If not, I really don't know what to say. Sorry.

Maybe you could test with the original track cfg & ini files? Or test your configuration in other computer.

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.