[Feature] Add option to duck music player volume instead of pausing (#541)#862
Open
LoackyBit wants to merge 4 commits into
Open
[Feature] Add option to duck music player volume instead of pausing (#541)#862LoackyBit wants to merge 4 commits into
LoackyBit wants to merge 4 commits into
Conversation
…ausing (kyleneideck#541) Add support for auto-ducking the selected music player app's volume to 30% when other applications play audio, rather than pausing it. Closes kyleneideck#541
…der (kyleneideck#541) - Fix issue where volume is not restored after ducking by correctly checking for kBGMDeviceIsSilentExceptMusic state in the listener block and unpause queue. - Add a custom NSSlider to BGMPreferencesMenu to allow users to adjust the ducking volume percentage dynamically (defaulting to 30%). - Ensure the slider is enabled/disabled reactively depending on the "Duck instead of pause" state. - Update tests and user defaults database structure. Closes kyleneideck#541
…kyleneideck#541) Setting the fallback volume to 50 (the neutral midpoint) solves two issues: 1. Prevents ducking from failing (being a no-op) when set to exactly 50%. 2. Prevents the restored volume from jumping to 100% (boosted) upon unducking.
Author
|
@kyleneideck can you review and merge the PR? |
kyleneideck
reviewed
Jul 7, 2026
kyleneideck
reviewed
Jul 7, 2026
kyleneideck
reviewed
Jul 7, 2026
Owner
|
Hi @LoackyBit , thanks for the PR. I'm going to try to go through the PR backlog in order. I've been testing #853 and made some changes on top of it, but I think it's pretty close. So I'm not sure how long until I get to this one, but hopefully fairly soon. I had a quick look through and left a few minor comments, but overall it looks good so far. |
Author
|
Thanks for the review and the feedback @kyleneideck. I’ve already pushed a new commit implementing your suggestions. No rush on the merge, just let me know if you spot anything else I should improve. |
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
This PR implements the auto-ducking feature requested in issue #541. When enabled, instead of pausing the selected music player when other audio starts, Background Music will temporarily duck the music player's volume, restoring it when silence returns.
Key Changes
NSSliderfor Ducking Volume in the Preferences submenu to allow users to set the ducking volume level (0% to 100%, defaults to 30%).kBGMDeviceIsSilentExceptMusicinstead ofkBGMDeviceIsSilentwhen other audio stops. The listener block now correctly handles this state to trigger the unducking process.50(the neutral midpoint raw volume in the driver curve). This fixes an issue where a 50% ducking level resulted in a no-op, and prevents unducking from boosting the player volume to100(400% volume boost).Type of Change
Related Issues
Closes #541
How to Test