com.jsyn.data
Class AudioSample
java.lang.Object
com.jsyn.data.SequentialDataCommon
com.jsyn.data.AudioSample
- All Implemented Interfaces:
- SequentialData
- Direct Known Subclasses:
- FloatSample, ShortSample
public abstract class AudioSample
- extends SequentialDataCommon
Base class for FloatSample and ShortSample.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AudioSample
public AudioSample()
allocate
public abstract void allocate(int numFrames,
int channelsPerFrame)
getRateScaler
public double getRateScaler(int index,
double synthesisRate)
- Description copied from interface:
SequentialData
- Get rate to play the data. In an envelope this correspond to the inverse of the frame duration
and would vary frame to frame.
For an audio sample it is 1.0.
- Specified by:
getRateScaler
in interface SequentialData
- Specified by:
getRateScaler
in class SequentialDataCommon
- Returns:
- rate to scale the playback speed.
getFrameRate
public double getFrameRate()
setFrameRate
public void setFrameRate(double f)
getNumFrames
public int getNumFrames()
- Specified by:
getNumFrames
in interface SequentialData
- Overrides:
getNumFrames
in class SequentialDataCommon
- Returns:
- The number of valid frames that can be read.
getChannelsPerFrame
public int getChannelsPerFrame()
- Specified by:
getChannelsPerFrame
in interface SequentialData
- Specified by:
getChannelsPerFrame
in class SequentialDataCommon
- Returns:
- For a stereo sample, return 2.