public class PeakNormalisationCalculator extends AudioProcessor
getVolumeScalar()
method which will return the scalar as it
has currently been calculated for the stream which has passed. This will
only return the correct value for the whole audio stream once the whole
audio stream has passed through the processor. This processor will not
perform attenuation - that is, the volume scalar will always be greater
than 1 (and positive).
The value of the peak volume scalar is compatible with the
VolumeAdjustProcessor
which can adjust the volume to the maximum
peak value.
Constructor and Description |
---|
PeakNormalisationCalculator() |
Modifier and Type | Method and Description |
---|---|
float |
getVolumeScalar()
Returns the calculated peak scalar as it currently stands in the stream.
|
SampleChunk |
process(SampleChunk sample)
Function that takes a sample chunk and processes the chunk.
|
getLength, getUnderlyingStream, nextSampleChunk, process, processingComplete, reset, setUnderlyingStream
seek
public PeakNormalisationCalculator()
public SampleChunk process(SampleChunk sample) throws Exception
process
in class AudioProcessor
sample
- The sample chunk to process.Exception
- If the processing could not take placeAudioProcessor.process(org.openimaj.audio.SampleChunk)
public float getVolumeScalar()
Float.MAX_VALUE
otherwise the value will always be positive
and greater than 1.