public class Decimate extends AbstractSignalProcessor<AudioBuffer,AudioBuffer>
MultirateFilters.Decimator
,
Interpolate
lastOut, 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
AudioBuffer s
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
factor th frame will be kept. |
void |
setTargetSampleRate(float targetSampleRate) |
String |
toString() |
connectTo, connectTo, connectTo, disconnectFrom, flush, getConnectedProcessors, getConnectedSource, getId, getOutput, process, read, reset, setId
public Decimate(int factor)
factor
- nth frame to keeppublic Decimate()
public Decimate(float targetSampleRate)
AudioBuffer
s
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)
factor
th 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
AbstractSignalProcessor
processNext
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.