be.hogent.tarsos.dsp
Class DelayEffect

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

public class DelayEffect
extends java.lang.Object
implements AudioProcessor

Adds an echo effect to the signal.

Author:
Joren Six

Constructor Summary
DelayEffect(double echoLength, double decay, double sampleRate)
           
 
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 setDecay(double newDecay)
          A decay, should be a value between zero and one.
 void setEchoLength(double newEchoLength)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayEffect

public DelayEffect(double echoLength,
                   double decay,
                   double sampleRate)
Parameters:
echoLength - in seconds
sampleRate - the sample rate in Hz.
decay - The decay of the echo, a value between 0 and 1.
Method Detail

setEchoLength

public void setEchoLength(double newEchoLength)
Parameters:
newEchoLength - A new echo buffer length in seconds.

setDecay

public void setDecay(double newDecay)
A decay, should be a value between zero and one.

Parameters:
newDecay - the new decay (preferably between zero and one).

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