org.tritonus.dsp.processor
Class AmplitudeProcessor

java.lang.Object
  extended by org.tritonus.dsp.processor.AmplitudeProcessor
All Implemented Interfaces:
FloatSampleProcessor

public class AmplitudeProcessor
extends java.lang.Object
implements FloatSampleProcessor

Change amplitude of audio data.


Constructor Summary
AmplitudeProcessor()
           
 
Method Summary
 void process(FloatSampleBuffer buffer)
          Do the amplifying.
 void setAmplitudeLinear(float fAmplitude)
          Set the amplitude.
 void setAmplitudeLog(float fAmplitude)
          Set the amplitude.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AmplitudeProcessor

public AmplitudeProcessor()
Method Detail

setAmplitudeLinear

public void setAmplitudeLinear(float fAmplitude)
Set the amplitude. The value passed here is the value the samples are multiplied with. So 1.0F means no change in amplitude. 2.0F doubles the amplitude. 0.5F cuts it to half, and so on. This is in contrast to setAmplitudeLog, where you can pass the amplitude change as dB values.


setAmplitudeLog

public void setAmplitudeLog(float fAmplitude)
Set the amplitude. The value passed here is in dB. So 0.0F means no change in amplitude. +6.0F doubles the amplitude. -6.0F cuts it to half, and so on. This is in contrast to setAmplitudeLinear(), where you can pass the amplitude change linear values.


process

public void process(FloatSampleBuffer buffer)
Do the amplifying. Here, simply each sample in each channel is multiplied with the amplitude value.

Specified by:
process in interface FloatSampleProcessor