Interface Sampled
- All Known Implementing Classes:
AbstractSampled,ArraySampled,AudioFileSampled,ChannelFilteredSampled,EmptySampled,MonoSampled
public interface Sampled
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release resourcesfloatEnd time in secondsfloatGet length in secondsintGet the number of channels.intReturn the number of samplesfloatGet sample rate.floatGet start timedouble[][]getWindowExtrema(float startTime, float endTime) double[]getWindowExtrema(int channel, float startTime, float endTime) Get min/max values for specified time rangevoidgetWindowExtrema(int channel, float startTime, float endTime, double[] extrema) Get min/max values for specified time rangedouble[][]getWindowExtrema(int firstSample, int lastSample) double[]getWindowExtrema(int channel, int firstSample, int lastSample) Get the miminum and maximum values for the specified sample rangevoidgetWindowExtrema(int channel, int firstSample, int lastSample, double[] extrema) Get min/max values for specified windowintloadSampleData(double[][] buffer, int offset, int firstSample, int numSamples) doublemaximumValue(int channel, float startTime, float endTime) Get the maximum value for the specified time rangedoublemaximumValue(int channel, int firstSample, int lastSample) Get the maximum value for the specified sample rangedoubleminimumValue(int channel, int firstSample, int lastSample) Get the minimum value for the specified sample rangeintsampleForTime(float time) Convert a time value to a sample indexdoublevalueForSample(int channel, int sample) Get value for sampledoublevalueForTime(int channel, float time) Get value for specified time
-
Method Details
-
getNumberOfChannels
int getNumberOfChannels()Get the number of channels.- Returns:
- number of channels
-
getNumberOfSamples
int getNumberOfSamples()Return the number of samples- Returns:
- number of samples
-
getSampleRate
float getSampleRate()Get sample rate.- Returns:
- sample rate (samples/second)
-
valueForSample
double valueForSample(int channel, int sample) Get value for sample- Parameters:
channel-sample- index
-
sampleForTime
int sampleForTime(float time) Convert a time value to a sample index- Parameters:
time- (in seconds)- Returns:
- sample index or -1 if time is outside Sampled data range
-
valueForTime
double valueForTime(int channel, float time) Get value for specified time- Parameters:
time-- Returns:
- value at specified time
-
getStartTime
float getStartTime()Get start time- Returns:
- start time in seconds
-
getEndTime
float getEndTime()End time in seconds- Returns:
- end time in seconds
-
getLength
float getLength()Get length in seconds- Returns:
- length in seconds
-
close
-
maximumValue
double maximumValue(int channel, int firstSample, int lastSample) Get the maximum value for the specified sample range- Parameters:
channel-firstSample-lastSample-- Returns:
- maximum value for specified range
-
maximumValue
double maximumValue(int channel, float startTime, float endTime) Get the maximum value for the specified time range- Parameters:
channel-startTime-endTime-- Returns:
- maximum value for specified range
-
minimumValue
double minimumValue(int channel, int firstSample, int lastSample) Get the minimum value for the specified sample range- Parameters:
channel-firstSample-lastSample-- Returns:
- minimum value for specified range
-
loadSampleData
int loadSampleData(double[][] buffer, int offset, int firstSample, int numSamples) -
getWindowExtrema
double[][] getWindowExtrema(int firstSample, int lastSample) -
getWindowExtrema
double[][] getWindowExtrema(float startTime, float endTime) -
getWindowExtrema
double[] getWindowExtrema(int channel, int firstSample, int lastSample) Get the miminum and maximum values for the specified sample range- Parameters:
channel-firstSample-lastSample-- Returns:
- min/max values for range
-
getWindowExtrema
void getWindowExtrema(int channel, int firstSample, int lastSample, double[] extrema) Get min/max values for specified window- Parameters:
channel-firstSample-extrema-ladSample-
-
getWindowExtrema
double[] getWindowExtrema(int channel, float startTime, float endTime) Get min/max values for specified time range- Parameters:
channel-startTime-endTime-- Returns:
- min/max values for specified range
-
getWindowExtrema
void getWindowExtrema(int channel, float startTime, float endTime, double[] extrema) Get min/max values for specified time range- Parameters:
channel-startTime-endTime-extrema- an array of double[2] where the data will be stored
-