public class SampleThread extends AbstractFilter
sampleSize, source
Constructor and Description |
---|
SampleThread(SampleProvider source,
float sampleRate)
Create an instance and run at
sampleRate . |
Modifier and Type | Method and Description |
---|---|
void |
fetchSample(float[] dst,
int off)
Fetches a sample from a sensor or filter.
|
float |
getSampleRate() |
boolean |
isNewSampleAvailable() |
void |
setSampleRate(float rate) |
void |
start()
Start the sampling (Default at instantiation)
|
void |
stop()
Stop the sampling
|
sampleSize
public SampleThread(SampleProvider source, float sampleRate)
sampleRate
.source
- A SampleProvidersampleRate
- The sample rate expressed in Hertz (Samples / second)public boolean isNewSampleAvailable()
public void fetchSample(float[] dst, int off)
SampleProvider
fetchSample
in interface SampleProvider
fetchSample
in class AbstractFilter
dst
- The array to store the sample in.off
- The elements of the sample are stored in the array starting at the offset position.public float getSampleRate()
public void setSampleRate(float rate)
rate
- in Hzpublic void start()
public void stop()