com.jsyn.data
Class FloatSample

java.lang.Object
  extended by com.jsyn.data.SequentialDataCommon
      extended by com.jsyn.data.AudioSample
          extended by com.jsyn.data.FloatSample
All Implemented Interfaces:
SequentialData

public class FloatSample
extends AudioSample

Store multi-channel floating point audio data in an interleaved buffer. The values are stored as 32-bit floats.


Constructor Summary
FloatSample()
           
FloatSample(float[] data)
          Constructor for mono samples with data.
FloatSample(int numFrames)
          Constructor for mono samples.
FloatSample(int numFrames, int channelsPerFrame)
           
 
Method Summary
 void allocate(int numFrames, int channelsPerFrame)
           
 double interpolate(double fractionalIndex)
           
 void read(float[] data)
           
 void read(int startFrame, float[] data, int startIndex, int numFrames)
           
 double readDouble(int index)
          Read a value at the given index.
 void write(float[] data)
           
 void write(int startFrame, float[] data, int startIndex, int numFrames)
           
 void writeDouble(int index, double value)
          Write a value at the given index.
 
Methods inherited from class com.jsyn.data.AudioSample
getChannelsPerFrame, getFrameRate, getNumFrames, getRateScaler, setFrameRate
 
Methods inherited from class com.jsyn.data.SequentialDataCommon
getReleaseBegin, getReleaseEnd, getSustainBegin, getSustainEnd, setReleaseBegin, setReleaseEnd, setSustainBegin, setSustainEnd
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatSample

public FloatSample()

FloatSample

public FloatSample(int numFrames)
Constructor for mono samples.


FloatSample

public FloatSample(float[] data)
Constructor for mono samples with data.


FloatSample

public FloatSample(int numFrames,
                   int channelsPerFrame)
Method Detail

allocate

public void allocate(int numFrames,
                     int channelsPerFrame)
Specified by:
allocate in class AudioSample

write

public void write(int startFrame,
                  float[] data,
                  int startIndex,
                  int numFrames)

read

public void read(int startFrame,
                 float[] data,
                 int startIndex,
                 int numFrames)

write

public void write(float[] data)

read

public void read(float[] data)

readDouble

public double readDouble(int index)
Description copied from interface: SequentialData
Read a value at the given index.

Specified by:
readDouble in interface SequentialData
Specified by:
readDouble in class SequentialDataCommon

writeDouble

public void writeDouble(int index,
                        double value)
Description copied from interface: SequentialData
Write a value at the given index. Values are organized by frame. So index = ((channelsPerFrame*frameIndex)+channelIndex)

Specified by:
writeDouble in interface SequentialData
Specified by:
writeDouble in class SequentialDataCommon

interpolate

public double interpolate(double fractionalIndex)