Downloader: link preferred bitrate to JDA requested format.
This commit is contained in:
parent
ae7fe8cc7b
commit
b0415b0324
|
@ -28,6 +28,7 @@ import javax.json.JsonArray;
|
||||||
import javax.json.JsonObject;
|
import javax.json.JsonObject;
|
||||||
import javax.json.JsonReader;
|
import javax.json.JsonReader;
|
||||||
import moe.nekojimi.chords.Downloader.DownloadTask;
|
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 INFO_TIMEOUT = 10;
|
||||||
private static final int FORMAT_TIMEOUT = 5;
|
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+(.*)$");
|
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)");
|
public static final Pattern DESTINATION_PATTERN = Pattern.compile("Destination: (.*\\.wav)");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue