Repository navigation
Add Reduce Loud Sounds audio option - #2111
Open
new-usemame wants to merge 12 commits into
Open
new-usemame wants to merge 12 commits into
new-usemame wants to merge 12 commits into
Conversation
With the setting off the processor still ran the leveler, so Off cost as much CPU as on. Off now copies the input straight through and leaves the core idle. Turning it on mid-stream starts a fresh core and fades it in; turning it off fades it out, drains its delay, then copies again. A seek right after turning it on resets instead of keeping an estimate from before the core went idle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PidZAomEJnEqTEMxAeYnmC
# Conflicts: # app/src/main/java/com/github/damontecres/wholphin/services/PlayerFactory.kt # app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackDialog.kt # app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt # app/src/main/java/com/github/damontecres/wholphin/ui/playback/overlay/PlaybackControls.kt # app/src/main/res/values/strings.xml
Author
|
I've been using this for a few weeks now and would love to get it merged so I don't have to keep both a debug and a prod Wholphin on my machine 🙃 |
Owner
This PR has large changes to several critical parts of the codebase and it's also AI generated, so it will be a while before I find time to review. Plus, I will have to devote a significant amount of time to review. So please don't expect this to be considered for merging anytime soon. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds "Reduce Loud Sounds" in the Video Player Audio menu and in Settings > Playback. Off by default.
When it's on, it evens out audio within a title (loud effects come down, quiet dialogue comes up) and between titles: the leveler resets when a new item starts, so a loud episode after a quiet movie doesn't jump. In my test that jump was 1.4 dB with it on vs 5.2 dB off.
My goal was to match Apple's Reduce Loud Sounds which seems to also bring up quiet sounds to be heard. I find this especially useful at night, too. Prefer it to be called 'Reduce Loud Sounds' instead of 'Night Mode' because 1. it's familiar, 2. it's the generic primary pain point.
It only works on decoded PCM in ExoPlayer, so with it on, offload, tunneling and passthrough are turned off for that player. Passthrough can't be processed without decoding it, and leaving offload and tunneling out kept this first version simpler. Turning it on mid-video either switches the processor in place (if the audio is already PCM) or rebuilds the player at the same position and tracks. With it off, the output is bit-exact. MPV and external players are untouched, and in that case the switch shows "Requires ExoPlayer".
The processing is three plain Kotlin files in
playback/leveling/core(loudness measurement, leveler/compressor, limiter), with no native code or new dependencies. A lot of the diff is tests.Related issues
#1845
Testing
Screenshots
Settings > Playback:

Audio menu during playback:

With MPV / Prefer MPV selected:

AI or LLM usage
I have professional experience with LLM coding workflows, and used AI assistance (Claude and GPT), including on the processor in
playback/leveling/coreand the ExoPlayer integration. I've reviewed it all, and it was tested as described above.