public abstract class AudioProcessor extends AudioStream
AudioStream interface thereby making processors
chainable.| Constructor and Description |
|---|
AudioProcessor()
A default constructor for processing sample chunks or files in an ad-hoc
manner.
|
AudioProcessor(AudioStream a)
Construct a new processor based on the given stream.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
Returns the length of the audio stream in milliseconds.
|
AudioStream |
getUnderlyingStream()
Get the underlying stream.
|
SampleChunk |
nextSampleChunk()
Retrieve the next SampleChunk from the audio stream.
|
void |
process(AudioStream a)
Function to process a whole audio stream.
|
abstract SampleChunk |
process(SampleChunk sample)
Function that takes a sample chunk and processes the chunk.
|
void |
processingComplete(AudioStream a)
Called when the processing of a given audio stream has been completed.
|
void |
reset()
Reset the audio stream.
|
void |
setUnderlyingStream(AudioStream stream)
Sets the underlying stream, allowing it to be changed.
|
iterator, seekclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic AudioProcessor()
public AudioProcessor(AudioStream a)
a - The audio stream to process.public void process(AudioStream a) throws Exception
a - The audio stream to process.Exception - If the processing failedpublic abstract SampleChunk process(SampleChunk sample) throws Exception
sample - The sample chunk to process.Exception - If the processing could not take placepublic void processingComplete(AudioStream a)
a - The audio stream that has finished processing.public SampleChunk nextSampleChunk()
nextSampleChunk in class AudioStreamAudioStream.nextSampleChunk()public AudioStream getUnderlyingStream()
public void setUnderlyingStream(AudioStream stream)
stream - The streampublic void reset()
reset in class AudioStreamAudioStream.reset()public long getLength()
getLength in class AudioStreamAudioStream.getLength()