public class FloatSample extends AudioSample
| Constructor and Description |
|---|
FloatSample() |
FloatSample(float[] data)
Constructor for mono samples with data.
|
FloatSample(float[] data,
int channelsPerFrame)
Constructor for multi-channel samples with data.
|
FloatSample(int numFrames)
Constructor for mono samples.
|
FloatSample(int numFrames,
int channelsPerFrame)
Create an silent sample with enough memory to hold the audio data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
allocate(int numFrames,
int channelsPerFrame)
Allocate memory to hold the audio data.
|
double |
interpolate(double fractionalIndex) |
void |
read(float[] data) |
void |
read(int startFrame,
float[] data,
int startIndex,
int numFrames)
Note that in a stereo sample, a frame has two values.
|
double |
readDouble(int index)
Read a value from the sample independently from the internal storage
format.
|
void |
write(float[] data)
Write the entire array to the sample.
|
void |
write(int startFrame,
float[] data,
int startIndex,
int numFrames)
Note that in a stereo sample, a frame has two values.
|
void |
writeDouble(int index,
double value)
Write a value at the given index.
|
addMarker, getChannelsPerFrame, getFrameRate, getMarker, getMarkerCount, getNumFrames, getPitch, getRateScaler, setChannelsPerFrame, setFrameRate, setPitchgetReleaseBegin, getReleaseEnd, getSustainBegin, getSustainEnd, setReleaseBegin, setReleaseEnd, setSustainBegin, setSustainEndpublic FloatSample()
public FloatSample(int numFrames)
public FloatSample(float[] data)
public FloatSample(float[] data,
int channelsPerFrame)
public FloatSample(int numFrames,
int channelsPerFrame)
numFrames - number of sample groups. A stereo frame contains 2 samples.channelsPerFrame - 1 for mono, 2 for stereopublic void allocate(int numFrames,
int channelsPerFrame)
allocate in class AudioSamplenumFrames - number of sample groups. A stereo frame contains 2 samples.channelsPerFrame - 1 for mono, 2 for stereopublic void write(int startFrame,
float[] data,
int startIndex,
int numFrames)
startFrame - index of frame in the sampledata - data to be writtenstartIndex - index of first value in arraynumFrames - public void read(int startFrame,
float[] data,
int startIndex,
int numFrames)
startFrame - index of frame in the sampledata - array to receive the data from the samplestartIndex - index of first location in array to start fillingnumFrames - public void write(float[] data)
data - public void read(float[] data)
public double readDouble(int index)
SequentialDatareadDouble in interface SequentialDatareadDouble in class SequentialDataCommonindex - sample index is ((frameIndex * channelsPerFrame) +
channelIndex)public void writeDouble(int index,
double value)
SequentialDatawriteDouble in interface SequentialDatawriteDouble in class SequentialDataCommonindex - sample index is ((frameIndex * channelsPerFrame) +
channelIndex)value - the value to be writtenpublic double interpolate(double fractionalIndex)