Skip to content

feat: dynamic range compressor for dialogue boost / action limiting - #3117

Merged
fire-light42 merged 78 commits into
recloudstream:masterfrom
fgmitesh:feat/dynamic-range-compressor
Oct 5, 2026
Merged

fire-light42 merged 78 commits into
recloudstream:masterfrom
fgmitesh:feat/dynamic-range-compressor

Conversation

@fgmitesh

@fgmitesh fgmitesh commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds a real-time dynamic range compressor accessible via a new
"Compressor" button next to Tracks in the player controls.

Ported from VLC's compressor.c (LGPL, Steve Harris / Ronald Wright).
Implemented as a Media3 AudioProcessor injected into DefaultAudioSink
— sits directly in the audio pipeline, zero overhead when disabled.

Controls: threshold, ratio, attack, release, makeup gain.
All adjustable live via sliders with no player reload needed.
Settings are persisted across sessions.
Defaults: threshold -14dB, ratio 4:1, attack 10ms, release 50ms,
makeup +6dB.

Works with both nextlib and default decoder paths.
Full TV remote navigation. Correctly included in isDialogOpen().

This PR was developed with AI assistance (Claude by Anthropic) for implementation and bug hunting. All code has been tested on a real Android TV device and a phone.

This class implements a real-time dynamic range compressor as an AudioProcessor, allowing for audio signal compression based on specified parameters. It includes methods for configuring audio format, processing input, and managing internal state.
Added support for dynamic range compression in audio sink.
Added a DynamicRangeCompressor instance to the audio sink for live parameter updates.
@fgmitesh

fgmitesh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

TESTING IS REMAINING = DRAFT FOR NOW

@fgmitesh

fgmitesh commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

It's almost done (Yeah it's W.I.P)

@fgmitesh

Copy link
Copy Markdown
Contributor Author

It's working now but needs little work

Refactor compressor dialog handling and update UI elements for better readability and maintainability.
@fgmitesh

Copy link
Copy Markdown
Contributor Author

Fixed all points from the review:

  • Semicolons → newlines throughout showCompressorDialog()
  • Added dynamic hint text under threshold/makeup gain sliders explaining what they do (same pattern as subtitle sync)
  • selectCompressorDialog now has the same autoHide setter as the other dialogs
  • Braces added around the single-line if
  • Replaced deprecated setEnableAudioTrackPlaybackParams with setEnableAudioOutputPlaybackParameters
  • Compressor is now nullable and only created when the setting is on — when off, DefaultRenderersFactory/FixedNextRenderersFactory fall back to fully default behavior, no custom AudioProcessor touches the pipeline at all
  • Preset buttons now stay highlighted correctly when reopening the dialog, based on current values

Also fixed a build-breaking XML tag mismatch and a string formatting warning from CI.

@fgmitesh

Copy link
Copy Markdown
Contributor Author

fixed typo

@fgmitesh

Copy link
Copy Markdown
Contributor Author

done!

@fire-light42

Copy link
Copy Markdown
Collaborator

I will try to review tomorrow 👍

@fgmitesh

Copy link
Copy Markdown
Contributor Author

Whoops note for firelight I tired to make it competible with the new ui and the features option is gone I'm outside right now I cannot fix it can u do it for me while porting to new version

@fgmitesh

Copy link
Copy Markdown
Contributor Author

Compatibile*

Removed the 'compressor_enabled_key' string from resources.
Added newline characters for better formatting in legal notice text.
@fgmitesh

Copy link
Copy Markdown
Contributor Author

Trying to fix it i cannot figure out it

@fgmitesh

fgmitesh commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author

**I tested it and its finnally done!
also so the codefactor issue is from the new updates not my fault
its also ported to letest version :D
WAITING FOR U TO REVIEW AND TEST IT @fire-light43 @fire-light42 **

@fire-light42

Copy link
Copy Markdown
Collaborator

Apologies for the late review, I have been busy. I will try to review soon 👍

@fire-light42 fire-light42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job!

@fire-light42
fire-light42 merged commit 4e2516d into recloudstream:master Oct 5, 2026
1 of 2 checks passed
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.

2 participants