public class SlidingWindow extends AbstractSignalProcessor<AudioBuffer,AudioBuffer>
SlidingWindow
.
read()
returns null
.
Object.clone()
it.
OLA
lastOut, signalProcessorSupport
Constructor and Description |
---|
SlidingWindow()
Creates a processor with a window length of 2048 frames and 1024 hop size.
|
SlidingWindow(int sliceLengthInFrames)
Produces windows with a given frame length.
|
SlidingWindow(int sliceLengthInFrames,
int hopSizeInFrames)
Produces windows of frames that overlap to a certain degree.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
void |
flush()
Flushes this processor and its kids.
|
int |
getHopSizeInFrames() |
int |
getSliceLengthInFrames() |
int |
hashCode() |
void |
process(AudioBuffer buffer)
Asks this processor to work on the provided data and pipe the
output to the connected processors' own
SignalProcessor.process(Object) method.Implementing methods must not modify or hold on to the provided data. |
protected AudioBuffer |
processNext(AudioBuffer buffer)
Processes the given input and returns some output.
|
AudioBuffer |
read()
If no new data can be obtained the last few blocks/windows are zero padded until
all data disappeared from the window.
|
void |
reset()
Calls
SignalSource.reset() , if a source is set. |
void |
setHopSizeInFrames(int hopSizeInFrames) |
void |
setSliceLengthInFrames(int sliceLengthInFrames) |
String |
toString() |
connectTo, connectTo, connectTo, disconnectFrom, getConnectedProcessors, getConnectedSource, getId, getOutput, setId
public SlidingWindow()
public SlidingWindow(int sliceLengthInFrames, int hopSizeInFrames)
sliceLengthInFrames
- frames per windowhopSizeInFrames
- number of frames two consecutive windows overlappublic SlidingWindow(int sliceLengthInFrames)
sliceLengthInFrames
- frames per windowpublic int getHopSizeInFrames()
public void setHopSizeInFrames(int hopSizeInFrames)
public int getSliceLengthInFrames()
public void setSliceLengthInFrames(int sliceLengthInFrames)
public void reset()
AbstractSignalProcessor
SignalSource.reset()
, if a source is set.reset
in interface SignalSource<AudioBuffer>
reset
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
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 occurspublic void flush() throws IOException
AbstractSignalProcessor
flush
in interface SignalProcessor<AudioBuffer,AudioBuffer>
flush
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
IOException
- if a processing error occurspublic void process(AudioBuffer buffer) throws IOException
SignalProcessor
SignalProcessor.process(Object)
method.Object.clone()
method.
It is the responsibility of implementing classes to call the SignalProcessor.process(Object)
method of any connected processors. To manage connected processors classes may want
to use a SignalProcessorSupport
instance.process
in interface SignalProcessor<AudioBuffer,AudioBuffer>
process
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
buffer
- data to processIOException
- if a processing error occursSignalProcessor.getConnectedProcessors()
public AudioBuffer read() throws IOException
read()
returns null
.read
in interface SignalSource<AudioBuffer>
read
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
IOException
- if something goes wrongCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.