* @param binary
* The location of the binary
* @param rate
- * The new sampling rate
*/
public SoxResampleFilter(String binary, int rate) {
+ super(String.format("Resample to %s kHz", rate / 1000.0));
this.binary = binary;
this.rate = rate;
}
//
@Override
- public Metadata metadata() {
- return super.metadata().frequency(rate);
- }
-
- @Override
public void open(Metadata metadata) throws IOException {
checkNotNull(metadata, "metadata must not be null");
checkArgument(metadata.encoding().equalsIgnoreCase("PCM"), "source must be PCM-encoded");
- super.open(metadata);
+ super.open(metadata.frequency(rate));
}
//