Repository navigation
Adjust sample store retrieval API to allow more flexibility - #6834
Merged
Merged
Conversation
1 task done
bdach
reviewed
Oct 8, 2026
| /// <param name="applyGlobalSampleVolume">Whether the game-wide effect volume adjustment should be applied to samples retrieved from the resultant store.</param> | ||
| public ISampleStore GetSampleStore(IResourceStore<byte[]> store = null, AudioMixer mixer = null, bool applyGlobalSampleVolume = true) | ||
| { | ||
| if (store == null) return globalSampleStore.Value; |
Collaborator
There was a problem hiding this comment.
I don't know what this was about but it blames back to f3d0071 and I can not be bothered to blame this back further in game repository prior to the splitting out of framework. At least there don't look to be any usages either in framework or in game that pass null store.
Member
Author
There was a problem hiding this comment.
I think it was likely just an "optimisation", like "don't create one when it's clear we don't need to". But now we kinda need to.
bdach
approved these changes
Oct 8, 2026
bdach
pushed a commit
to ppy/osu
that referenced
this pull request
Oct 13, 2026
) - Builds off #28733 - Addresses #37901, #38410, #18654, #25068, #34798 - [x] Depends on ppy/osu-framework#6834 Caveats: - Intentionally called "hitsound volume", not "gameplay volume" because the intention is to specifically target hitsounds. Gameplay effects should still be adjusted by the effect volume, as far as I'm concerned. (alternative take: call this gameplay and include everything non-UI, then rename "effect" to "UI sounds" or something) - Affects everything in the playfield and overlay layers. This seems like a pretty good separation point, which includes things like the metronome from muted mod. It's about what players will expect from this. - Does not affect storyboards. I'm sure we're going to get people complaining about that meaning that "storyboarded hitsounds" are not affected, but I'm not sure whether this is a correct take or not. - The following now reads bad. It looks as if the "beatmap hitsounds" would be a toggle turning them off, not enabling/disabling beatmap skinned hitsounds. Open to suggestion: <img width="726" height="456" alt="CleanShot 2026-10-06 at 21 48 33@2x" src="https://github.com/user-attachments/assets/23cedcdf-fe2f-49c9-b3d6-b6204f1d9af0" /> There may be exceptions that come up which we need to handle separately. I may do a 180 based on how this is received and adjust more than one of the caveats above. Tachyon feedback will be important here. I also have started on a redesign of the volume overlay to better house this. Consider the one in this PR a temporary change. --- This brings a long-sought feature online. I'm not 100% sure on what this should or shouldn't cover, so any feedback is appreciated on how this works for you! <img width="3428" height="2154" alt="CleanShot 2026-10-06 at 21 50 49@2x" src="https://github.com/user-attachments/assets/72b714f3-f244-4987-b1bf-ca8e41d23ec9" />
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.
This change is specifically made with the goal of adding localised volume adjustment for hitsounds during gameplay. It turns out the global "sample" or "effect" volume is added at a framework level via sample retrieval (not hierarchically, for historical reasons), which makes it hard to create a localised adjustment which isn't also affected by the sample volume.
The changes to this API allows:
bool applyGlobalSampleVolumeparameter.The latter of these changes may have potential to cause issues if someone happened to be calling the function expecting the default store every time, but I strongly doubt this was ever the case. At least is not the case for our own usages, so I don't think there's an issue with changing this API. Also, the new version makes more sense to me.