Skip to content

Commit

Permalink
Consider global hitsound volume when playing samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Dec 7, 2024
1 parent fc05f11 commit 1e1fb4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ru/nsu/ccfit/zuev/audio/BassSoundProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public void play(float volume) {
return;
}

if (volume == 0) {
float finalVolume = volume * Config.getSoundVolume();

if (finalVolume == 0) {
stop();
return;
}
Expand All @@ -86,7 +88,7 @@ public void play(float volume) {
stop();

BASS.BASS_ChannelPlay(channel, true);
BASS.BASS_ChannelSetAttribute(channel, BASS.BASS_ATTRIB_VOL, volume * Config.getSoundVolume());
BASS.BASS_ChannelSetAttribute(channel, BASS.BASS_ATTRIB_VOL, finalVolume);
}

public void stop() {
Expand Down

0 comments on commit 1e1fb4b

Please sign in to comment.