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
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<T extends AudioSpectrum,AudioBuffer>
buffer
- data to processIOException
- if a processing error occursSignalProcessor.getConnectedProcessors()
public void flush() throws IOException
SignalProcessor
SignalProcessor.flush()
method.flush
in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>
IOException
- if a processing error occurspublic AudioBuffer getOutput() throws IOException
SignalProcessor
SignalProcessor.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()
SignalProcessor
SignalProcessor.getOutput()
.getId
in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>
SignalPump.pump()
public int getChannelCount()
SignalSplit
getChannelCount
in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>
public <O2> SignalProcessor<AudioBuffer,O2> connectTo(int channel, SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalSplit
connectTo
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)
SignalSplit
disconnectFrom
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)
SignalSplit
getConnectedProcessors
in interface SignalSplit<T extends AudioSpectrum,AudioBuffer>
channel
- channel or bandnull
SignalProcessor.disconnectFrom(com.tagtraum.jipes.SignalProcessor)
,
SignalProcessor.connectTo(com.tagtraum.jipes.SignalProcessor)
public <O2> SignalProcessor<AudioBuffer,O2> connectTo(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalProcessor
connectTo
in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>
O2
- output type of the processor we want to connect toaudioBufferSignalProcessor
- processorSignalProcessor.disconnectFrom(SignalProcessor)
,
SignalProcessor.getConnectedProcessors()
,
SignalPipeline
public <O2> SignalProcessor<AudioBuffer,O2> disconnectFrom(SignalProcessor<AudioBuffer,O2> audioBufferSignalProcessor)
SignalProcessor
disconnectFrom
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()
SignalProcessor
getConnectedProcessors
in interface SignalProcessor<T extends AudioSpectrum,AudioBuffer>
null
SignalProcessor.disconnectFrom(SignalProcessor)
,
SignalProcessor.connectTo(SignalProcessor)
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.