/** The bitrate to encode to. */
private final Optional<Integer> bitrate;
+ /** Whether to use highest quality encoding. */
+ private boolean hq = false;
+
/**
* Creates a new LAME MP3 encoder.
*
this.bitrate = (bitrate < 0) ? Optional.<Integer>absent() : Optional.<Integer>of(bitrate);
}
+ /**
+ * Sets whether to use highest quality encoding.
+ *
+ * @param hq
+ * {@code true} to use highest quality encoding, {@code false} otherwise
+ * @return This MP3 encoder
+ */
+ public LameMp3Encoder hq(boolean hq) {
+ this.hq = hq;
+ return this;
+ }
+
//
// EXTERNALFILTER METHODS
//
parameters.add(String.valueOf(bitrate.get()));
}
parameters.add("-p");
- parameters.add("-q").add("0");
+ if (hq) {
+ parameters.add("-q").add("0");
+ }
parameters.add("-").add("-");
return parameters.build();
}