be.hogent.tarsos.dsp
Class Oscilloscope

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

public class Oscilloscope
extends java.lang.Object
implements AudioProcessor

The oscilloscope generates a float array with array[i] an x coordinate in percentage array[i+1] the value of the amplitude in audio buffer array[i+2] another x coordinate in percentage array[i+3] the next amplitude in the audio buffer The implementation is based on the one by Dan Ellis found at http://www.ee.columbia.edu/~dpwe/resources/Processing/

Author:
Dan Ellis, Joren Six

Nested Class Summary
static interface Oscilloscope.OscilloscopeEventHandler
           
 
Constructor Summary
Oscilloscope(Oscilloscope.OscilloscopeEventHandler handler)
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Oscilloscope

public Oscilloscope(Oscilloscope.OscilloscopeEventHandler handler)
Method Detail

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