INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Replaygain Values for FLAC files  (Read 15873 times)

Gene_Clark

  • Member
  • *
  • Posts: 3
Replaygain Values for FLAC files
« on: August 03, 2009, 10:45:53 am »

I have a lot (over 30000) FLAC files, which all have replaygain values assigned. These assignments were done either with foobar2000 or dbPoweramp. These replaygain values are displayable and readable (used) by the following programs:
foobar2000, dbpoweramp, winamp 5.x, helium 2008 and later.
They are neither displayable nor used by jriver media center v14.
Does jriver media center use other tags, if yes which ones? Does it use own database fields instead?
I am not exactly keen to reevaluate these values again.
Though I searched the forum, I didn't find any solution nor a hint where the program stores the replaygain values.
Thanks for any help
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13487
Re: Replaygain Values for FLAC files
« Reply #1 on: August 03, 2009, 11:12:33 am »

Please attach a small sample file or send it to bob at jriver dot com.

Thanks.
Logged

Gene_Clark

  • Member
  • *
  • Posts: 3
Re: Replaygain Values for FLAC files
« Reply #2 on: August 03, 2009, 01:05:32 pm »

Thanks for taking care of this problem. Mail and file sent.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Replaygain Values for FLAC files
« Reply #3 on: August 03, 2009, 06:20:04 pm »

In case anyone is interested...

FLAC files being rather large, a while ago I created a flactruncate perl script that will strip the body from FLAC files.  It will not touch original files, instead creates small copies that include tags only.  It can operate on one or more files, or a directory full, and will place the results in a mirrored directory tree.

This allows submission of FLAC file tags sans music content.

Available at:

   http://www.mikecappella.com/slimtools/flactruncate.pl
Logged
The opinions I express represent my own folly.

Gene_Clark

  • Member
  • *
  • Posts: 3
Re: Replaygain Values for FLAC files
« Reply #4 on: August 04, 2009, 08:32:22 am »

Thanks MrC. Next time I will use your script, instead of uploading the file(s).
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #5 on: August 04, 2009, 01:33:09 pm »

First, I just wanted to say that I am experiencing the same as the OP (using flac files ripped with dBpoweramp and using that software to apply replay gain, including album gain, at ripping). Nothing is showing up in the MC fields for replay gain and album gain although the tags are there.

Then, I want to ask a question regarding replay gain, including album gain, applied with Foobar2000 on mp3 files (yes, I know it is a bit off topic, but I hope someone will answer anyway). The question is: How does MC interpret and use replay gain tags in mp3 files? The replay gain and album gain fields in MC are filled with values, but those values are generally considerably higher (or should it be "lower" since the loudness war of the record industry seems to almost always produce rather high negative replay gain values?) than the values in the tags. Should the fields in MC not reflect what is in the tags, or is MC using some intelligence of its own that I am not aware of?

I am a new user so I may have overlooked something. I also very seldom use MC for playback, but when I do I get the clear impression that playback of at least mp3 files is generally noticeable lower than when I use other software, using replay gain, for playback (always on 100% volume set in the software).

This is what is in a sample file (as shown in MC):
MPEG-1 Layer 3
256 Kbit CBR
44.1 Khz Joint stereo

Copyrighted: No
Original: Yes
Protected by CRC: No
Encoder: LAME
Gapless: Yes (576 start, 2240 end)

ID3v1 Tag: none

ID3v2.3 Tag: (107248 bytes)
  TALB (Album): Brand New Day
  TPE1 (Artist): Sting
  TCOM (Composer): Sting
  TPOS (Disc #): 1/1
  TCON (Genre): Rock
  TIT2 (Name): After The Rain Has Fallen
  TRCK (Track #): 4/10
  TYER (Year): 2000
  TXXX (replaygain_album_g..): -6.45 dB
  TXXX (replaygain_album_p..): 1.103976
  TXXX (replaygain_track_g..): -6.74 dB
  TXXX (replaygain_track_p..): 1.065895
  APIC (Image File) (Cover): <too large to display>

In MC (I use MC 13) the Album Gain field shows "-10,23" and the Replay Gain field shows "-12,74".

I have opened the actual mp3 file with WordPad and searched for those values (-10.23 and -12.74 as well as -10,23 and -12,74 with commas as, for some reason, displayed in MC) but they simple do not exist in the file, as read by WordPad.

(I would have liked to attach actual screen shots but I could not figure out how to do this in the forums. Since bob in his post suggested attaching a file, I am pretty sure I am missing something obvious...)
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #6 on: August 04, 2009, 02:13:12 pm »

The reference level inside MC is the original 83 dB. AFAIK, JRiver's Media Jukebox was the first player program with a built-in replay gain scanner and playback correction system over seven and half years ago. More info about the original Replay Gain standard: http://replaygain.hydrogenaudio.org/

Some other programs have later changed to use the 89 dB reference level. However, you don't need to worry. The MP3 tagger component in MC corrects the difference automatically (as you found out) and the system works correctly. If you want the files play louder you can set MC to use a fixed adjustment (+6 dB would make it identical with the players that use 89 dB).

The FLAC problem will be fixed in a similar way soon, but probably only in MC14.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #7 on: August 05, 2009, 04:08:14 am »

The reference level inside MC is the original 83 dB. AFAIK, JRiver's Media Jukebox was the first player program with a built-in replay gain scanner and playback correction system over seven and half years ago. More info about the original Replay Gain standard: http://replaygain.hydrogenaudio.org/

Some other programs have later changed to use the 89 dB reference level. However, you don't need to worry. The MP3 tagger component in MC corrects the difference automatically (as you found out) and the system works correctly. If you want the files play louder you can set MC to use a fixed adjustment (+6 dB would make it identical with the players that use 89 dB).

The FLAC problem will be fixed in a similar way soon, but probably only in MC14.

Thank you for the explanation, which cleared up the mystery for me, and a +6 dB fixed adjustment made the music sound the same as with other playback software. It is also good to hear that the flac issue will be addressed.

Will the set +6 dB adjustment only affect playback in MC? If I should use MC to apply RPG to new files, or reapply RPG, would the target level still be 83 dB when MC calculates the values and writes them to the tags in the files? If so, I suspect that other software will play those files at a lower volume than the "old" files with a target level of 89 dB.
Logged

Fritz_Gerlich

  • Recent member
  • *
  • Posts: 5
Re: Replaygain Values for FLAC files
« Reply #8 on: August 12, 2009, 11:37:12 pm »

This is just a note from a potential customer that has chosen not to use MC. 

100% standardized replaygain support is a deal-breaker for me, and I imagine a lot of other FLAC users as well.  It might be a good idea to bring your approach in line with all the other replaygain programs because most people don't want to mess with their tags once they have their library set up.  Plug and play is key to sales, cause if someone likes to putz they'll already be happily using foobar.
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #9 on: August 13, 2009, 02:30:05 am »

Will the set +6 dB adjustment only affect playback in MC? If I should use MC to apply RPG to new files, or reapply RPG, would the target level still be 83 dB when MC calculates the values and writes them to the tags in the files? If so, I suspect that other software will play those files at a lower volume than the "old" files with a target level of 89 dB.

It is a playback DSP setting. Also other Replay Gain aware programs have a similar setting that can be used for adjusting the master gain. It doesn't change the values in the library or in the file tags.

The tags are separate from the DSP settings and the reference level correction is automatic in both directions in order to make the tags fully compatible.

Regarding the FLAC format:
 
A tested and bug fixed implemention willl be included in the next public MC14 build. The current build, 14.0.46, has some minor issues with the replay gain tag format. Although the written tags seem to work correctly with other common programs it might be best to not write tags until the next build is out.

100% standardized replaygain support is a deal-breaker for me, and I imagine a lot of other FLAC users as well.  It might be a good idea to bring your approach in line with all the other replaygain programs because most people don't want to mess with their tags once they have their library set up.  Plug and play is key to sales, cause if someone likes to putz they'll already be happily using foobar.

The new implementation including tag writing is fully compatible.

There is slight difference in the album gain system because MC calculates the album gain values dynamically from the track gain values and doesn't need the album gain file tags, but MC doesn't change or remove existing album gain values.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #10 on: August 13, 2009, 02:58:50 am »

Thanks for the reply!

The tags are separate and the correction is automatic in both directions in order to make the tags fully compatible.

[...]

The new implementation including tag writing is fully compatible.

Sorry for being a bit slow but could you please clarify what you mean by compatible. Will RPG values calculated by MC and written to the tags be the same as if they had been calculated and written by, say, dBpoweramp with a target volume of 89dB?

There is slight difference in the album gain system because MC calculates the album gain values dynamically from the track gain values and doesn't need the album gain file tag, but MC does not change or remove existing album gain values.

If MC is used to calculate RPG, will no album gain tag be written to the file by MC?
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #11 on: August 13, 2009, 03:34:41 am »

Thanks for the reply!

Sorry for being a bit slow but could you please clarify what you mean by compatible. Will RPG values calculated by MC and written to the tags be the same as if they had been calculated and written by, say, dBpoweramp with a target volume of 89dB?

Yes. (Some decimal digits may slightly differ because each implementation uses its own code, but the target level is 89 dB.)

Quote
If MC is used to calculate RPG, will no album gain tag be written to the file by MC?

Yes.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #12 on: August 13, 2009, 03:46:17 am »

Yes. (Some decimal digits may slightly differ because each implimentation uses its own code, but the target level is 89 dB.)

Yes.

Thanks again for clarifying this!

The first answer was encouraging, but the second was not.

May I put forward a feature request to write also album gain values to the tags (mp3 and flac) when MC is calculating RPG. Other software, such as SqueezeCenter, depends on the album gain tag for "correct" playback between albums.
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #13 on: August 13, 2009, 04:07:47 am »

Here's a thread from the distant past:

Topic & link: Album Gain Solution (FEEDBACK WANTED)

Replay Gain breaks a song into chunks, analyzes their volume, sorts those chunks by volume, then says "hey, the 95% loudest chunk is the reference for that file."  Then, during playback, you compare the reference marks of the different files and adjust the volumes accordingly.

Album Gain does the same thing, except it thinks of albums as one giant song.  That means it takes the 95% loudest chunk of the whole album for the reference mark.

Using Album Gain makes it so albums that have tracks that are supposed to be quiet actually are quiet.

Both types of gains have their place.  Currently MC doesn't support Album Gain.

The solution I'm proposing is for MC to calculate the Album Gain from the Replay Gain of the tracks on the albums.  This requires no extra analysis and avoids the GUI pitfalls of forcing full albums to analyze together.

The Album Gain could be calculated as the loudest track Replay Gain from all the tracks on the album.  A more elaborate calculation scheme could also be employed. (weighted averaging based on volume and duration, etc.)

It seems to me like this would work equally well as calculating the files again.  Replay Gain isn't an exact science, and the difference between the two methods would only be a few tenths of a decimal.  Neither method would really be more correct -- just different.

So, would this make those pining for Album Gain completely happy?

Thanks for any feedback.

The linked thread might help to understand why MC calculates the album gain values dynamically from the track gain values.


And here's one of my not so old replies:

Topic & link: Flac and Replay Gain

This was fixed in a very elegant way in the MP3 input plugin. The current plugin can read the old proprietary tags, but it writes tags that conform the de facto standard, including the +6 dB correction (and the -6 dB correction when the new tags are read).

The only part that is still missing from the "de facto" MP3 replay gain tags is the album gain part (= the album gain and the album peak tags).

The JRiver programs calculate the album gain value dynamically by averaging the track gain values. The album peak value is not stored separately in the library.

Most, if not all, other programs analyze the complete album as a single track in addition to analyzing the individual tracks. The resulting values are stored in the replaygain_album_gain and replaygain_album_peak tags.

I have suggested how the album gain part could be handled:
http://yabb.jriver.com/interact/index.php?topic=38695.0
http://yabb.jriver.com/interact/index.php?topic=45465.0
http://yabb.jriver.com/interact/index.php?topic=45711.0
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #14 on: August 13, 2009, 10:26:42 am »

Thanks, Alex B, for the pointers. You really do know the forums, the application and the tags. It is a blessing for us new users that you combine that with patience and a very helpful attitude.

Of course I fully support the ideas you put forward for handling the album gain issue. I would like to use MC for as many tasks as possible, but until MC can write "standard" album gain tags I cannot use MC to calculate RPG.

I am afraid a quick fix meaning that MC just wrote the album gain value calculated by MC to the "standard" album gain tag would not satisfy me. I imported the album gain tag for mp3 files into MC and compared the values with what MC had calculated as album gain (taking into account the 6 dB difference) and in some instances there was a difference of several (at least 3 or 4) dB, when the track gain varied much in an album.
Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #15 on: August 13, 2009, 11:19:43 am »

But which implementation is more correct, i.e. represents better the perceived loudness of the complete album?

- The method that splits the whole album in 50 ms blocks, measures each individual block, sorts the resulting values in the loudness order and picks the value that is at the "95% point" in the list of the values (if I understood the explanation in the following link correctly: http://replaygain.hydrogenaudio.org/statistical_process.html).

or

- The method that calculates the album gain value from the separately analyzed track values? (The individual tracks are measured as explained above.)


I'd guess that there is no correct answer. Each album is different and also each listener may have a different opinion about the experienced overall loudness during a long listening session that consists of several individual tracks.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #16 on: August 13, 2009, 11:53:36 am »

I'd like to add that I use MC's "Album Gain" and "Automatic adjustment" settings most of the time.

It seems to work fine for me. It keeps the current "Playing Now" list as loud as possible without causing clipping, compensates quite well the clearly audible volume level differences between different albums, and keeps also the quieter album tracks as quiet as the artist intended.

I use the same settings also when I listen to a mixed playlist that consists only of single tracks from various albums.

In the rare occasions when I really want to play background music at a low volume level I may switch to the track gain mode.

EDIT

However, the "automatic adjustment" can work nicely only if the Playing Now list always contains lots of tracks. For instance, if there is only one track in the list it will just make the track as loud as possible. If you play one track or very few tracks at a time it is better to use a fixed adjustment.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #17 on: August 13, 2009, 12:43:30 pm »

But which implementation is more correct, i.e. represents better the perceived loudness of the complete album?

- The method that splits the whole album in 50 ms blocks, measures each individual block, sorts the resulting values in the loudness order and picks the value that is at the "95% point" in the list of the values (if I understood the explanation in the following link correctly: http://replaygain.hydrogenaudio.org/statistical_process.html).

or

- The method that calculates the album gain value from the separately analyzed track values? (The individual tracks are measured as explained above.)


I'd guess that there is no correct answer. Each album is different and also each listener may have a different opinion about the experienced overall loudness during a long listening session that consists of several individual tracks.

I agree with you that there probably is no correct answer to the question of which method to calculate album gain is the most correct. I am sure I will be very happy upon playback in MC with MC's method, just like you are. I was not trying to use the existing replay gain values, calculated by dBpoweramp or foobar, in the tags in my mp3 files as a point of reference for the most correct replay gain values.

The whole point of applying RPG is to get a more "even" listening experience when listening to your music collection. Therefore it is counterproductive to apply RPG to your collection using different tools which produce different results on the same files. My point was that if MC was to write "standard" album gain tags it should/must use the de facto standard for calculating album gain (at least when writing the tag; inside MC all is well since MC wisely uses only one method, its own, to apply album gain upon playback) since the result of MC's current method is sometimes significantly different from what you get in your tags with tools using the de facto standard (such as dBpoweramp, foobar and, I think, also MediaMonkey since I believe that it uses the same method as MP3Gain but stores ID3 tags instead of APE tags).

Logged

Alex B

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 10121
  • The Cosmic Bird
Re: Replaygain Values for FLAC files
« Reply #18 on: August 13, 2009, 01:12:01 pm »

I am sure the JRiver developers will carefully consider your arguments before they take any further steps.

For now, especially if you want to use also other players, you could just analyze the files with some other program instead of using the built-in analyzer.

MC can read the track gain and peak tags correctly and use its own album gain system automatically if the file format is MP3 or FLAC.
Logged
The Cosmic Bird - a triple merger of galaxies: http://eso.org/public/news/eso0755

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Replaygain Values for FLAC files
« Reply #19 on: August 14, 2009, 02:35:22 am »

I am sure the JRiver developers will carefully consider your arguments before they take any further steps.

For now, especially if you want to use also other players, you could just analyze the files with some other program instead of using the built-in analyzer.

MC can read the track gain and peak tags correctly and use its own album gain system automatically if the file format is MP3 or FLAC.

Yes, I will do that, and I have not experienced any issues regarding how MC is using RPG values already in the tags (except of course for the flac issue, which I hope will be solved shortly) for playback. It is just a pity that I for compatability reasons cannot use MC to apply or re-apply RPG when needed.
Logged

flac.rules

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1260
Re: Replaygain Values for FLAC files
« Reply #20 on: August 14, 2009, 11:44:50 am »

I agree with vagskal here, implmenting a calculation and writing of ablum RG-info the same way as other programs do it can be independent of how MC uses its own "internal" RG during playback, and it will ensure better compability with other programs.
Logged

imeric

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1466
Re: Replaygain Values for FLAC files
« Reply #21 on: February 03, 2015, 09:08:08 am »

I'M happy I ran into this thread ..Why isn't jriver using the same tagging "standard" as dBpoweramp and foobar for replay gain anymore?? Instead of adding more tags R128 could have simply been implemented in the existing replay gain tags?

thx
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10710
Re: Replaygain Values for FLAC files
« Reply #22 on: February 03, 2015, 09:24:24 am »

MC20 writes normal replaygain tags in ID3v2.
Logged
~ nevcairiel
~ Author of LAV Filters

mario620

  • Member
  • *
  • Posts: 2
Re: Replaygain Values for FLAC files
« Reply #23 on: June 17, 2015, 12:45:47 pm »

MC20 writes normal replaygain tags in ID3v2.

does this mean that it can read album gain tags done by foobar? If yes, can JR read them from both flac and dsf files?
Logged
Pages: [1]   Go Up