Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close ReplayGain support, #4915 #4932

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Close ReplayGain support, #4915 #4932

merged 1 commit into from
Jun 10, 2024

Conversation

low-batt
Copy link
Contributor

This commit will:

  • Add new the settings replayGain, replayGainPreamp, replayGainClip and replayGainFallback to the Preferences class
  • Add support for the new settings to the mpvInit method in the MPVController class
  • Add a ReplayGain section to the Video/Audio tab of IINA's settings

These changes allow the user to control mpv's support for ReplayGain tags.


Description:

@low-batt
Copy link
Contributor Author

The following mpv options support ReplayGain:

By default mpv ignores ReplayGain tags. Currently users must enable this feature using a mpv configuration file or by setting these options in IINA's Advanced settings.

The commit adds a direct mapping to these options. The default values for the IINA settings match mpv:

  • replaygain: no
  • replaygain-preamp: 0
  • replaygain-clip: no
  • replaygain-fallback: 0

So by default IINA will ignore ReplayGain tags.

The default settings look like:
defaults

With ReplayGain enabled the settings look like:
active

To test this feature I installed rsgain using brew:

brew install complexlogic/tap/rsgain

And then ran it over a set of mp3 files:

Running rsgain:
low-batt@gag issue-4915$ rsgain easy -m 10 .
[✔] Building directory tree...
[✔] Found 2 directories...
[✔] Scanning directories for files...

Scanning Complete
Time Elapsed:      00:00:06
Files Scanned:     9
Clip Adjustments:  0 (0.0% of files)
Average Gain:      -5.98 dB
Average Peak:      1.000000 (0.00 dB)
Negative Gains:    9 (100.0% of files)
Positive Gains:    0 (0.0% of files)

low-batt@gag issue-4915$ 

Playing one of those files with ReplayGain enabled the mpv log contains ReplayGain related messages:

[  70.271][v][cplayer] Replaygain: Track=-5.980000/1.000000 Album=-5.980000/1.000000
[  70.271][v][cplayer] Applying replay-gain: 0.502343
[  70.271][v][cplayer] ...with clipping prevention: 0.502343

The mpv track-list property contains ReplayGain information:

  • track-list/N/replaygain-track-peak
  • track-list/N/replaygain-track-gain
  • track-list/N/replaygain-album-peak
  • track-list/N/replaygain-album-gain

I considered adding ReplayGain information to the Inspector window, but was uncertain how to integrate that information from a UI design perspective. This can be a separate enhancement. Currently the ability to configure properties to watch can be used:
inspector

@low-batt low-batt linked an issue May 19, 2024 that may be closed by this pull request
@low-batt low-batt mentioned this pull request May 19, 2024
This commit will:
- Add new the settings replayGain, replayGainPreamp, replayGainClip and
  replayGainFallback to the Preferences class
- Add support for the new settings to the mpvInit method in the
  MPVController class
- Add a ReplayGain section to the Video/Audio tab of IINA's settings

These changes allow the user to control mpv's support for ReplayGain
tags.
Copy link
Member

@uiryuu uiryuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are good to me. We should let the users to test out this feature in the upcoming beta.

@uiryuu uiryuu merged commit 300641e into develop Jun 10, 2024
1 check passed
@uiryuu uiryuu deleted the replaygain branch June 10, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReplayGain support
2 participants