be.hogent.tarsos.dsp
Class GainProcessor

java.lang.Object
  extended by be.hogent.tarsos.dsp.GainProcessor
All Implemented Interfaces:
AudioProcessor

public class GainProcessor
extends java.lang.Object
implements AudioProcessor

With the gain processor it is possible to adapt the volume of the sound. With a gain of 1, nothing happens. A gain greater than one is a volume increase a gain between zero and one, exclusive, is a decrease. If you need to flip the sign of the audio samples, you can by providing a gain of -1.0. but I have no idea what you could gain by doing that (pathetic pun, I know).

Author:
Joren Six

Constructor Summary
GainProcessor(double newGain)
           
 
Method Summary
 boolean process(AudioEvent audioEvent)
          Process the audio event.
 void processingFinished()
          Notify the AudioProcessor that no more data is available and processing has finished.
 void setGain(double newGain)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GainProcessor

public GainProcessor(double newGain)
Method Detail

setGain

public void setGain(double newGain)

process

public boolean process(AudioEvent audioEvent)
Description copied from interface: AudioProcessor
Process the audio event. Do the actual signal processing on an (optionally) overlapping buffer.

Specified by:
process in interface AudioProcessor
Parameters:
audioEvent - The audio event that contains audio data.
Returns:
False if the chain needs to stop here, true otherwise. This can be used to implement e.g. a silence detector.

processingFinished

public void processingFinished()
Description copied from interface: AudioProcessor
Notify the AudioProcessor that no more data is available and processing has finished. Can be used to deallocate resources or cleanup.

Specified by:
processingFinished in interface AudioProcessor