public class AudioConverter extends AudioProcessor
Constructor and Description |
---|
AudioConverter(AudioFormat input,
AudioFormat output)
Constructor that takes the input and output formats.
|
AudioConverter(AudioStream stream,
AudioFormat output)
Chainable constructor that takes the stream to chain and the
output format to convert the stream to.
|
Modifier and Type | Method and Description |
---|---|
static AudioProcessor |
calculateProcess(AudioFormat input,
AudioFormat output)
Calculates the chain of processors that will convert from one format to the
other and will return the first in the chain.
|
AudioFormat |
getOutputFormat()
Same as
Audio.getFormat() for this class - returns the output format. |
SampleChunk |
process(SampleChunk sample)
Function that takes a sample chunk and processes the chunk.
|
getLength, getUnderlyingStream, nextSampleChunk, process, processingComplete, reset, setUnderlyingStream
iterator, seek
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public AudioConverter(AudioStream stream, AudioFormat output)
stream
- The stream to chain tooutput
- The required output formatpublic AudioConverter(AudioFormat input, AudioFormat output)
input
- The input formatoutput
- The output formatpublic static AudioProcessor calculateProcess(AudioFormat input, AudioFormat output)
input
- The input formatoutput
- The output format.public SampleChunk process(SampleChunk sample) throws Exception
AudioProcessor
process
in class AudioProcessor
sample
- The sample chunk to process.Exception
- If the processing could not take placepublic AudioFormat getOutputFormat()
Audio.getFormat()
for this class - returns the output format.