Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Metaflac 1.3.0 and high sample rates (Read 3999 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Metaflac 1.3.0 and high sample rates

I thought that I remembered that metaflac included with FLAC 1.3.0 was capable of computing ReplayGain on high sample rate Flac files. But the --help documentation for --add-replay-gain states:

All FLAC files specified must have the same resolution, sample
rate, and number of channels.  The sample rate must be one
of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, or 48 kHz.

I ran it on a 24/96 files and it added RG tags. So, is the documentation wrong, and if so, what sample rates are actually supported?

Metaflac 1.3.0 and high sample rates

Reply #1
The documentation is outdated, FLAC 1.3.0 has had a few patches on this issue.

If I understood this correctly, the last patches made it so that FLAC automatically downsamples for analysis. The basic samplerates supported are 48kHz, 44kHz, 37.8kHz, 36kHz, 32kHz, 28kHz, 24kHz, 22.05kHz, 16kHz, 12kHz, 11.025kHz and 8kHz. Now, the description of the patch is a bit vague, but apparently multiples of 2, 4, 8, 16 etc. are supported. However, I just tested, and FLAC seems to handle any samplerate without complain. I'm not sure whether that's a bug...
Music: sounds arranged such that they construct feelings.

Metaflac 1.3.0 and high sample rates

Reply #2
However, I just tested, and FLAC seems to handle any samplerate without complain. I'm not sure whether that's a bug...

Sorry, I did something wrong there. It seems I understood the patch correctly, for example, 48, 96 and 192kHz are handled (as they are 48, 2x48, 4x48), as is 151.2kHz (4x37.8) but 240kHz (5x48kHz) is not supported.
Music: sounds arranged such that they construct feelings.

Metaflac 1.3.0 and high sample rates

Reply #3
However, I just tested, and FLAC seems to handle any samplerate without complain. I'm not sure whether that's a bug...

Sorry, I did something wrong there. It seems I understood the patch correctly, for example, 48, 96 and 192kHz are handled (as they are 48, 2x48, 4x48), as is 151.2kHz (4x37.8) but 240kHz (5x48kHz) is not supported.

Do you know which patch implemented this? Do you have a link to the commit? It would be useful to create a patch to update the documentation (https://www.xiph.org/flac/documentation_tools_metaflac.html) and a reference to the patches will help speed it up.
Every night with my star friends / We eat caviar and drink champagne
Sniffing in the VIP area / We talk about Frank Sinatra
Do you know Frank Sinatra? / He's dead


Metaflac 1.3.0 and high sample rates

Reply #5
I've been playing around with this today using test files to see what metaflac 1.3.0 accepts. Add 18.9kHz to your list (this can also be seen in the patch to replaygain_analysis.c) and 44kHz should be 44.1kHz.

The complete list appears to be:

8, 11.025, 12, 16, 18.9, 22.05, 24, 28, 32, 36, 37.8, 44.1, 48 kHz

I think you're correct about it accepting even multiples. For example, 28 and 56 kHz are supported, 84 kHz is not. Not sure if it has a limit. It was able to handle files with sample rates of 576 (36 x 16) and 604.8 (37.8 x 16) kHz.