This repository has been archived by the owner on May 8, 2022. It is now read-only.
forked from lavalink-devs/Lavalink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
517ae89
commit d4ba3d9
Showing
9 changed files
with
129 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
51 changes: 51 additions & 0 deletions
51
LavalinkServer/src/main/java/lavalink/server/player/filters/configs/EchoConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package lavalink.server.player.filters.configs; | ||
|
||
import lavalink.server.player.filters.FilterConfig; | ||
import me.rohank05.echo.EchoPcmAudioFilter; | ||
import com.sedmelluq.discord.lavaplayer.filter.AudioFilter; | ||
import com.sedmelluq.discord.lavaplayer.filter.FloatPcmAudioFilter; | ||
import com.sedmelluq.discord.lavaplayer.format.AudioDataFormat; | ||
import org.json.JSONObject; | ||
|
||
public class EchoConfig implements FilterConfig { | ||
private float decay = -1; | ||
private double delay = -1; | ||
|
||
public float getDecay() { | ||
return this.decay; | ||
} | ||
|
||
public double getDelay() { | ||
return this.delay; | ||
} | ||
|
||
public void setDecay(float decay) { | ||
this.decay = decay; | ||
} | ||
|
||
public void setDelay(double delay) { | ||
this.delay = delay; | ||
} | ||
|
||
@Override | ||
public String getFilterName() { | ||
return "echo"; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return FilterConfig.isSet(this.decay, -1) || FilterConfig.isSet((float) this.delay, -1); | ||
} | ||
|
||
@Override | ||
public AudioFilter create(AudioDataFormat format, FloatPcmAudioFilter output) { | ||
return new EchoPcmAudioFilter(output, format.channelCount, format.sampleRate) | ||
.setDecay(this.decay) | ||
.setDelay(this.delay); | ||
} | ||
|
||
@Override | ||
public JSONObject encode() { | ||
return new JSONObject().put("decay", this.decay).put("delay", this.delay); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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