public class Decimate extends AbstractSignalProcessor<AudioBuffer,AudioBuffer>
MultirateFilters.Decimator,
InterpolatelastOut, signalProcessorSupport| Constructor and Description |
|---|
Decimate()
Creates a decimate processor that drops/keeps every second frame.
|
Decimate(float targetSampleRate)
Creates a decimate processor that attempts to decimate
AudioBuffers
to the specified target sample rate. |
Decimate(int factor)
Keeps every nth frame, drops all other frames.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getFactor() |
float |
getTargetSampleRate() |
int |
hashCode() |
protected AudioBuffer |
processNext(AudioBuffer buffer)
Processes the given input and returns some output.
|
void |
setFactor(int factor)
Every
factorth frame will be kept. |
void |
setTargetSampleRate(float targetSampleRate) |
String |
toString() |
connectTo, connectTo, connectTo, disconnectFrom, flush, getConnectedProcessors, getConnectedSource, getId, getOutput, process, read, reset, setIdpublic Decimate(int factor)
factor - nth frame to keeppublic Decimate()
public Decimate(float targetSampleRate)
AudioBuffers
to the specified target sample rate.
Note that not all sample rates are supported. The ratio between sample rates
should be an integer.
If the target sample rate is not supported, an IOException is thrown
when processing the first buffer.targetSampleRate - target sample ratepublic int getFactor()
setFactor(int)public float getTargetSampleRate()
public void setTargetSampleRate(float targetSampleRate)
targetSampleRate - target sample ratepublic void setFactor(int factor)
factorth frame will be kept.
So if you specify 2, every 2nd frame will be kept.
If you specify 3, every third frame will be kept - leading to a sample rate reduction of,
e.g. 44100 to 44100/3 = 14700.factor - frame to keepIllegalArgumentException - not all factors are supportedcom.tagtraum.jipes.math.MultirateFilters.Decimator#Decimator(int)protected AudioBuffer processNext(AudioBuffer buffer) throws IOException
AbstractSignalProcessorprocessNext in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>buffer - input guaranteed not to be null.IOException - if an IO error occursCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.