public class ComplexOnsetDetector extends java.lang.Object implements AudioProcessor, OnsetDetector
Constructor and Description |
---|
ComplexOnsetDetector(int fftSize) |
ComplexOnsetDetector(int fftSize,
double peakThreshold) |
ComplexOnsetDetector(int fftSize,
double peakThreshold,
double minimumInterOnsetInterval) |
ComplexOnsetDetector(int fftSize,
double peakThreshold,
double minimumInterOnsetInterval,
double silenceThreshold) |
Modifier and Type | Method and Description |
---|---|
boolean |
process(AudioEvent audioEvent)
Process the audio event.
|
void |
processingFinished()
Notify the AudioProcessor that no more data is available and processing
has finished.
|
void |
setHandler(OnsetHandler handler) |
void |
setThreshold(double threshold) |
public ComplexOnsetDetector(int fftSize, double peakThreshold, double minimumInterOnsetInterval, double silenceThreshold)
fftSize
- The size of the fft to take (e.g. 512)peakThreshold
- A threshold used for peak picking. Values between 0.1 and 0.8. Default is 0.3, if too many onsets are detected adjust to 0.4 or 0.5.silenceThreshold
- The threshold that defines when a buffer is silent. Default is -70dBSPL. -90 is also used.minimumInterOnsetInterval
- The minimum inter-onset-interval in seconds. When two onsets are detected within this interval the last one does not count. Default is 0.004 seconds.public ComplexOnsetDetector(int fftSize)
public ComplexOnsetDetector(int fftSize, double peakThreshold)
public ComplexOnsetDetector(int fftSize, double peakThreshold, double minimumInterOnsetInterval)
public boolean process(AudioEvent audioEvent)
AudioProcessor
process
in interface AudioProcessor
audioEvent
- The audio event that contains audio data.public void setHandler(OnsetHandler handler)
setHandler
in interface OnsetDetector
public void setThreshold(double threshold)
public void processingFinished()
AudioProcessor
processingFinished
in interface AudioProcessor