Package ipsk.audio.dsp
Class AudioBufferProcessor
- java.lang.Object
-
- ipsk.audio.dsp.AudioSampleProcessor
-
- ipsk.audio.dsp.AudioFrameProcessor
-
- ipsk.audio.dsp.AudioBufferProcessor
-
public abstract class AudioBufferProcessor extends AudioFrameProcessor
Base class to process audio data buffers.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
Fields Modifier and Type Field Description protected AudioBufferProcessorListener
abpl
protected int
frames
-
Fields inherited from class ipsk.audio.dsp.AudioSampleProcessor
ae, af, AUDITORY_THRESHOLD, bigEndian, channels, DEFAULT_0DB_SOUND_PRESSURE, frameSize, maxValue, minValue, pp, resolutionBits, sampleSize, signed
-
-
Constructor Summary
Constructors Constructor Description AudioBufferProcessor(AudioBufferProcessorListener abpl, javax.sound.sampled.AudioFormat af)
Create new processor for the given audio format.AudioBufferProcessor(javax.sound.sampled.AudioFormat af)
Create new processor for the given audio format.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
process(byte[] inData, int offset, int length)
Process the buffer data.protected abstract void
processFrame(float[] val)
Process one frame.boolean
setData(byte[] inData, int offset, int length)
-
Methods inherited from class ipsk.audio.dsp.AudioFrameProcessor
encode, encode, encodeToFloatValues, encodeValues, encodeValues, getDoubleValues, getFloatValues, getFloatValues, getFloatValues, getNormalizedInterleavedValues, getNormalizedInterleavedValues, getNormalizedValues
-
Methods inherited from class ipsk.audio.dsp.AudioSampleProcessor
amplitudeToSoundPressure, encodeValue, getChannels, getDoubleValue, getEncodedValue, getFloatValue, getFloatValue, getFrameSize, getNormalizedValue, getNormalizedValue, getSampleSize, setAudioFormat
-
-
-
-
Field Detail
-
abpl
protected AudioBufferProcessorListener abpl
-
frames
protected int frames
-
-
Constructor Detail
-
AudioBufferProcessor
public AudioBufferProcessor(javax.sound.sampled.AudioFormat af) throws AudioFormatNotSupportedException
Create new processor for the given audio format. The audio frames are converted to normalized (-1.0 to 1.0) float values.- Parameters:
af
- audio format to use- Throws:
AudioFormatNotSupportedException
-
AudioBufferProcessor
public AudioBufferProcessor(AudioBufferProcessorListener abpl, javax.sound.sampled.AudioFormat af) throws AudioFormatNotSupportedException
Create new processor for the given audio format. The listener is notified if the buffer processing has finished.- Parameters:
abpl
- processor listeneraf
- audio format to use- Throws:
AudioFormatNotSupportedException
-
-
Method Detail
-
setData
public boolean setData(byte[] inData, int offset, int length)
-
process
public void process(byte[] inData, int offset, int length)
Process the buffer data. The audio frames are converted to float values for each channel.- Parameters:
inData
- data bufferoffset
- offset in the buffer from where to read datalength
- length of data to process
-
processFrame
protected abstract void processFrame(float[] val)
Process one frame. This method has to be implemented.- Parameters:
val
-
-
-