Skip to content

Added rsgain ReplayGain backend - #6948

Open
teadoku wants to merge 3 commits into
beetbox:masterfrom
teadoku:add-rsgain-backend
Open

Added rsgain ReplayGain backend#6948
teadoku wants to merge 3 commits into
beetbox:masterfrom
teadoku:add-rsgain-backend

Conversation

@teadoku

@teadoku teadoku commented Aug 23, 2026

Copy link
Copy Markdown

Description

Adds new rsgain ReplayGain backend, which utilises the rsgain CLI tool currently used by the MusicBrainz Picard tagging tool for calculating ReplayGain 2.0 values. It supports a wide variety of formats and R128 tagging, works in both sample and true peak mode, can be used in parallel and also allows control of the maximum peak value allowed when using clipping protection. All existing replaygain configuration values are used, with a new max_peak configuration value that controls the clipping protection as mentioned beforehand.

Full list of changes:

  • Added RSGainBackend class that implements the Backend abstract class.
  • Added the backend class to the supported list of backends for the main ReplayGainPlugin class.
  • Added max_peak float configuration value that controls the maximum allowed peak, in decibels, when clipping protection is enabled via the noclip boolean configuration value. Default value is -1.0 as recommended by the EBU R 128 specification.
  • Updated test_replaygain.py with tests for new backend functionality.
  • Updated replaygain.rst documentation with details about the new backend and configuration value.
  • Updated changelog.rst

To Do

  • Documentation.
  • Changelog.
  • Tests. Note: I did not add a test for the new backend using the "full" example file, which is complete silence, as the rsgain tool returns 0.0 for the gain and negative infinity for the peak. This fails the assert max(gains) != 0.0 assertion.
@teadoku
teadoku requested a review from a team as a code owner August 23, 2026 12:47
@github-actions github-actions Bot added the replaygain replaygain plugin label Aug 23, 2026
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@teadoku teadoku changed the title Added rsgain ReplayGain backend and new max_peak configuration value. Aug 23, 2026
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 19.29825% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.99%. Comparing base (31c917b) to head (4046e11).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beetsplug/replaygain.py 19.29% 45 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6948      +/-   ##
==========================================
- Coverage   76.14%   75.99%   -0.16%     
==========================================
  Files         163      163              
  Lines       21580    21636      +56     
  Branches     3337     3344       +7     
==========================================
+ Hits        16433    16442       +9     
- Misses       4347     4392      +45     
- Partials      800      802       +2     
Files with missing lines Coverage Δ
beetsplug/replaygain.py 45.01% <19.29%> (-1.93%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

replaygain replaygain plugin

1 participant