Package ca.phon.audio
Interface Sampled
- All Known Implementing Classes:
AbstractSampled
,ArraySampled
,AudioFileSampled
,ChannelFilteredSampled
,EmptySampled
,MonoSampled
public interface Sampled
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release resourcesfloat
End time in secondsfloat
Get length in secondsint
Get the number of channels.int
Return the number of samplesfloat
Get sample rate.float
Get start timedouble[][]
getWindowExtrema
(float startTime, float endTime) double[]
getWindowExtrema
(int channel, float startTime, float endTime) Get min/max values for specified time rangevoid
getWindowExtrema
(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 rangevoid
getWindowExtrema
(int channel, int firstSample, int lastSample, double[] extrema) Get min/max values for specified windowint
loadSampleData
(double[][] buffer, int offset, int firstSample, int numSamples) double
maximumValue
(int channel, float startTime, float endTime) Get the maximum value for the specified time rangedouble
maximumValue
(int channel, int firstSample, int lastSample) Get the maximum value for the specified sample rangedouble
minimumValue
(int channel, int firstSample, int lastSample) Get the minimum value for the specified sample rangeint
sampleForTime
(float time) Convert a time value to a sample indexdouble
valueForSample
(int channel, int sample) Get value for sampledouble
valueForTime
(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
Release resources- Throws:
IOException
-
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
-