public class BandSplit<T extends AudioSpectrum> extends Object implements SignalSplit<T,AudioBuffer>
0 are collected in one buffer and then sent to the child processor for band/channel 0.
The same happens with magnitudes at index 1 and so on.| Constructor and Description |
|---|
BandSplit(int windowLength) |
| Modifier and Type | Method and Description |
|---|---|
<O2> SignalProcessor<AudioBuffer,O2> |
connectTo(int channel,
SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
Registers a child processor for a specific channel.
|
<O2> SignalProcessor<AudioBuffer,O2> |
connectTo(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
Connects this processor to another processor to forward processed data to.
|
<O2> SignalProcessor<AudioBuffer,O2> |
disconnectFrom(int channel,
SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
Removes a child processor from a specific channel.
|
<O2> SignalProcessor<AudioBuffer,O2> |
disconnectFrom(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
Disconnects a child processor.
|
void |
flush()
Asks to complete all pending operations.
|
int |
getChannelCount()
Number of channels the signal is split up into.
|
SignalProcessor<AudioBuffer,?>[] |
getConnectedProcessors()
Lists all connected processors.
|
SignalProcessor<AudioBuffer,?>[] |
getConnectedProcessors(int channel)
Lists all registered processors for a specific channel or band.
|
Object |
getId()
Arbitrary object to identify a processor.
|
AudioBuffer |
getOutput()
First calls
SignalProcessor.flush(), then returns the pending output, should there be any. |
void |
process(T 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. |
String |
toString() |
public BandSplit(int windowLength)
windowLength - the number of samples/magnitudes collected in each band to form the new (per) band bufferpublic void process(T buffer) throws IOException
SignalProcessorSignalProcessor.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<T extends AudioSpectrum,AudioBuffer>buffer - data to processIOException - if a processing error occursSignalProcessor.getConnectedProcessors()public void flush()
throws IOException
SignalProcessorSignalProcessor.flush() method.flush in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>IOException - if a processing error occurspublic AudioBuffer getOutput() throws IOException
SignalProcessorSignalProcessor.flush(), then returns the pending output, should there be any.
Note that this call may only succeed once to preserve memory.getOutput in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>null is returnedIOException - if a processing error occurspublic Object getId()
SignalProcessorSignalProcessor.getOutput().getId in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>SignalPump.pump()public int getChannelCount()
SignalSplitgetChannelCount in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>public <O2> SignalProcessor<AudioBuffer,O2> connectTo(int channel, SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalSplitconnectTo in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>O2 - output type of the processor we want to connect tochannel - channelaudioBufferSignalProcessor - processorSignalProcessor.disconnectFrom(com.tagtraum.jipes.SignalProcessor),
SignalProcessor.getConnectedProcessors()public <O2> SignalProcessor<AudioBuffer,O2> disconnectFrom(int channel, SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalSplitdisconnectFrom in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>O2 - output type of the processor we want to disconnect fromchannel - channelaudioBufferSignalProcessor - processorSignalProcessor.connectTo(com.tagtraum.jipes.SignalProcessor),
SignalProcessor.getConnectedProcessors()public SignalProcessor<AudioBuffer,?>[] getConnectedProcessors(int channel)
SignalSplitgetConnectedProcessors in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>channel - channel or bandnullSignalProcessor.disconnectFrom(com.tagtraum.jipes.SignalProcessor),
SignalProcessor.connectTo(com.tagtraum.jipes.SignalProcessor)public <O2> SignalProcessor<AudioBuffer,O2> connectTo(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalProcessorconnectTo in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>O2 - output type of the processor we want to connect toaudioBufferSignalProcessor - processorSignalProcessor.disconnectFrom(SignalProcessor),
SignalProcessor.getConnectedProcessors(),
SignalPipelinepublic <O2> SignalProcessor<AudioBuffer,O2> disconnectFrom(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalProcessordisconnectFrom in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>O2 - output type of the processor we want to disconnect fromaudioBufferSignalProcessor - processorSignalProcessor.connectTo(SignalProcessor),
SignalProcessor.getConnectedProcessors()public SignalProcessor<AudioBuffer,?>[] getConnectedProcessors()
SignalProcessorgetConnectedProcessors in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>nullSignalProcessor.disconnectFrom(SignalProcessor),
SignalProcessor.connectTo(SignalProcessor)Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.