chuck_charles
New Member
- Joined
- Feb 17, 2026
- Messages
- 4
- Likes
- 0
Hello everyone!
Please excuse if this is the wrong part of the forum to ask this and redirect me if necessary, this is my first post.
I am currently trying to get a nice and lightweight command-line based DR14 measurement and log for my Linux server.
Since the official plugin does not work under Linux and is not easily scriptable I tried modifying a python based implementation.
This worked kinda, I had to modify the rounding of the final DR value, but then the DR and Peak values matched the official foobar-plugin.
But the RMS bugs me to no end. It is agonizingly close, but over and undershoots by ~±0.03 dB every time. One channel is always larger than the official value and the other lower.
For example "Woman Tonight" by "America" from the 2016 Hearts release by AF and Steve Hoffman:
The official plugin says:
DR Peak RMS Duration Track
DR12 -0.73 dB -15.53 dB 2:25 08-Woman Tonight
Mine outputs:
DR Peak RMS Duration Track
DR12 -0.73 dB -15.51 dB 2:25 08 Woman Tonight.flac
With the
RMS_left = -15.383717 dB and
RMS_right = -15.641628 dB
My code boils down to this:
I tried everything I could think of to get closer to the originals RMS:
Does anyone have an idea what I could otherwise try or knows how the plugin works "under the hood", since its a compiled .dll?
Please excuse if this is the wrong part of the forum to ask this and redirect me if necessary, this is my first post.
I am currently trying to get a nice and lightweight command-line based DR14 measurement and log for my Linux server.
Since the official plugin does not work under Linux and is not easily scriptable I tried modifying a python based implementation.
This worked kinda, I had to modify the rounding of the final DR value, but then the DR and Peak values matched the official foobar-plugin.
But the RMS bugs me to no end. It is agonizingly close, but over and undershoots by ~±0.03 dB every time. One channel is always larger than the official value and the other lower.
For example "Woman Tonight" by "America" from the 2016 Hearts release by AF and Steve Hoffman:
The official plugin says:
DR Peak RMS Duration Track
DR12 -0.73 dB -15.53 dB 2:25 08-Woman Tonight
Mine outputs:
DR Peak RMS Duration Track
DR12 -0.73 dB -15.51 dB 2:25 08 Woman Tonight.flac
With the
RMS_left = -15.383717 dB and
RMS_right = -15.641628 dB
My code boils down to this:
y, sr = librosa.load(song["path"], sr=None, mono=False)y = y.Ts = y.shapey_rms = np.sqrt(2.0 * np.sum(y**2.0, 0) / float(s[0]))db_rms = 20.0 * np.log10(y_rms)db_rms = np.mean(db_rms)I tried everything I could think of to get closer to the originals RMS:
- Downmixing to mono and then calculating
- Using other means to get the mean of left and right RMS (geometric and harmonic)
- Truncating to 3s blocks and discarding the last < 3s block
- Summing 3s block energies then taking the RMS
- Forcing Python to use 32 bit float arithmetic
Does anyone have an idea what I could otherwise try or knows how the plugin works "under the hood", since its a compiled .dll?
