Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
fix volume errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LolWastedJS committed Jan 15, 2021
1 parent 175278e commit 66ed374
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class WebSocketHandlers(private val contextMap: Map<String, SocketContext>) {

fun volume(context: SocketContext, json: JSONObject) {
val player = context.getPlayer(json.getString("guildId"))
player.setVolume(json.getFloat("volume"))
player.setVolume(json.getInt("volume"))
}

fun equalizer(context: SocketContext, json: JSONObject) {
Expand Down Expand Up @@ -125,6 +125,13 @@ class WebSocketHandlers(private val contextMap: Map<String, SocketContext>) {

fun filters(context: SocketContext, guildId: String, json: String) {
val player = context.getPlayer(guildId)
player.filters = FilterChain.parse(json)

try {
val filters = FilterChain.parse(json)
player.filters = filters
} catch (ex: Exception) {
log.error("Error while parsing filters.", ex)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public void setPause(boolean state) {
* Sets the volume of this player.
* @param volume The volume to use.
*/
public void setVolume(float volume) {
filters.setVolume(volume / 100);
public void setVolume(int volume) {
player.setVolume(volume);
}


Expand Down

0 comments on commit 66ed374

Please sign in to comment.