public class AudioGenerator
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
AudioGenerator(int audioBufferSize,
int bufferOverlap)
Create a new generator.
|
AudioGenerator(int audioBufferSize,
int bufferOverlap,
int samplerate) |
Modifier and Type | Method and Description |
---|---|
void |
addAudioProcessor(AudioProcessor audioProcessor)
Adds an AudioProcessor to the chain of processors.
|
TarsosDSPAudioFormat |
getFormat() |
void |
removeAudioProcessor(AudioProcessor audioProcessor)
Removes an AudioProcessor to the chain of processors and calls processingFinished.
|
void |
resetTime() |
void |
run() |
float |
secondsProcessed() |
void |
setStepSizeAndOverlap(int audioBufferSize,
int bufferOverlap)
Set a new step size and overlap size.
|
void |
stop()
Stops dispatching audio data.
|
public AudioGenerator(int audioBufferSize, int bufferOverlap)
audioBufferSize
- The size of the buffer defines how much samples are processed
in one step. Common values are 1024,2048.bufferOverlap
- How much consecutive buffers overlap (in samples). Half of the
AudioBufferSize is common (512, 1024) for an FFT.public AudioGenerator(int audioBufferSize, int bufferOverlap, int samplerate)
public void setStepSizeAndOverlap(int audioBufferSize, int bufferOverlap)
audioBufferSize
- The size of the buffer defines how much samples are processed
in one step. Common values are 1024,2048.bufferOverlap
- How much consecutive buffers overlap (in samples). Half of the
AudioBufferSize is common (512, 1024) for an FFT.public void addAudioProcessor(AudioProcessor audioProcessor)
audioProcessor
- The AudioProcessor to add.public void removeAudioProcessor(AudioProcessor audioProcessor)
audioProcessor
- The AudioProcessor to remove.public void run()
run
in interface java.lang.Runnable
public void stop()
public void resetTime()
public TarsosDSPAudioFormat getFormat()
public float secondsProcessed()