com.jsyn.data
Class ShortSample

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

public class ShortSample
extends AudioSample

Store multi-channel short audio data in an interleaved buffer.


Constructor Summary
ShortSample()
           
ShortSample(int numFrames, int channelsPerFrame)
           
 
Method Summary
 void allocate(int numFrames, int channelsPerFrame)
           
 void read(int startFrame, short[] data, int startIndex, int numFrames)
           
 void read(short[] data)
           
 double readDouble(int index)
          Read a value at the given index.
 short readShort(int index)
           
 void write(int startFrame, short[] data, int startIndex, int numFrames)
           
 void write(short[] data)
           
 void writeDouble(int index, double value)
          Write a value at the given index.
 void writeShort(int index, short value)
           
 
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

ShortSample

public ShortSample()

ShortSample

public ShortSample(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,
                  short[] data,
                  int startIndex,
                  int numFrames)

read

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

write

public void write(short[] data)

read

public void read(short[] data)

readShort

public short readShort(int index)

writeShort

public void writeShort(int index,
                       short value)

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