diff --git a/src/main/java/moe/nekojimi/chords/Downloader.java b/src/main/java/moe/nekojimi/chords/Downloader.java index 0abb3ad..24892c6 100644 --- a/src/main/java/moe/nekojimi/chords/Downloader.java +++ b/src/main/java/moe/nekojimi/chords/Downloader.java @@ -28,6 +28,7 @@ import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonReader; import moe.nekojimi.chords.Downloader.DownloadTask; +import net.dv8tion.jda.api.audio.AudioSendHandler; /** * @@ -40,7 +41,7 @@ public class Downloader implements Consumer private static final int INFO_TIMEOUT = 10; private static final int FORMAT_TIMEOUT = 5; - private static final int BITRATE_TARGET = 64_000; + private static final int BITRATE_TARGET = (int) AudioSendHandler.INPUT_FORMAT.getSampleRate(); private static final Pattern FORMAT_PATTERN = Pattern.compile("^([\\w]+)\\s+([\\w]+)\\s+(\\w+ ?\\w*)\\s+(.*)$"); public static final Pattern DESTINATION_PATTERN = Pattern.compile("Destination: (.*\\.wav)");