X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsonitus%2Fdata%2Ffilter%2FLameMp3Decoder.java;h=b2d8ea0030a8479da6cdb6b9484847e07cf8cfde;hb=232733212d941b29fdaa0b1db134f9e8d6dcbcee;hp=aae01fea1ceb04cdce3d22b7e5bdc0e9b50b2084;hpb=9596adc0ca5b226e7682fc785f707d3fd1b2978e;p=sonitus.git diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/LameMp3Decoder.java b/src/main/java/net/pterodactylus/sonitus/data/filter/LameMp3Decoder.java index aae01fe..b2d8ea0 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/LameMp3Decoder.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/LameMp3Decoder.java @@ -17,7 +17,7 @@ package net.pterodactylus.sonitus.data.filter; -import net.pterodactylus.sonitus.data.Format; +import net.pterodactylus.sonitus.data.Metadata; import com.google.common.collect.ImmutableList; @@ -32,20 +32,29 @@ public class LameMp3Decoder extends ExternalMp3Decoder { private final String binary; /** Whether to swap bytes in the decoded output. */ - private final boolean swapBytes; + private boolean swapBytes; /** * Creates a new LAME MP3 decoder. * * @param binary * The location of the binary + */ + public LameMp3Decoder(String binary) { + this.binary = binary; + } + + /** + * Sets whether to swap bytes on the decoded output. + * * @param swapBytes * {@code true} to swap the decoded bytes, {@code false} to use platform * endianness + * @return This MP3 decoder */ - public LameMp3Decoder(String binary, boolean swapBytes) { - this.binary = binary; + public LameMp3Decoder swapBytes(boolean swapBytes) { this.swapBytes = swapBytes; + return this; } // @@ -53,12 +62,12 @@ public class LameMp3Decoder extends ExternalMp3Decoder { // @Override - protected String binary(Format format) { + protected String binary(Metadata metadata) { return binary; } @Override - protected Iterable parameters(Format format) { + protected Iterable parameters(Metadata metadata) { ImmutableList.Builder parameters = ImmutableList.builder(); parameters.add("--mp3input").add("--decode").add("-t"); if (swapBytes) {