|
|
|
@ -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<DownloadTask> |
|
|
|
|
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)"); |
|
|
|
|
|
|
|
|
|