Skip to content

Commit 555e1a5

Browse files
committed
Enable filter hotswap, extra debug line, small doc fix
1 parent 21f135d commit 555e1a5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

IMPLEMENTATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Using the player equalizer
123123
]
124124
}
125125
```
126-
There are 16 bands (0-15) that can be changed.
126+
There are 15 bands (0-14) that can be changed.
127127
`gain` is the multiplier for the given band. The default value is 0. Valid values range from -0.25 to 1.0,
128128
where -0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could
129129
also change the volume of the output.

LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public Supplier<AudioPlayerManager> audioPlayerManagerSupplier(AudioSourcesConfi
4545
if (sources.isHttp()) audioPlayerManager.registerSourceManager(new HttpAudioSourceManager());
4646
if (sources.isLocal()) audioPlayerManager.registerSourceManager(new LocalAudioSourceManager());
4747

48+
audioPlayerManager.getConfiguration().setFilterHotSwapEnabled(true);
49+
4850
return audioPlayerManager;
4951
};
5052
}

LavalinkServer/src/main/java/lavalink/server/player/Player.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public void setVolume(int volume) {
9191
}
9292

9393
public void setBandGain(int band, float gain) {
94+
log.debug("Setting band {}'s gain to {}", band, gain);
9495
equalizerFactory.setGain(band, gain);
9596

9697
if (gain == 0.0f) {
@@ -110,7 +111,7 @@ public void setBandGain(int band, float gain) {
110111
this.player.setFilterFactory(null);
111112
this.isEqualizerApplied = false;
112113
}
113-
} else {
114+
} else if (!this.isEqualizerApplied) {
114115
this.player.setFilterFactory(equalizerFactory);
115116
this.isEqualizerApplied = true;
116117
}

0 commit comments

Comments
 (0)