public class SampleQueueInputStream
- extends SampleQueueStream
Adds streaming read capabilities to a SynthSampleQueue.
The queue must be on a unit that will write data to the queue
such as a SampleWriter_16F1. The SampleWriter will write data to the sample that is then
read by this stream via the queue.
- (C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
- See Also:
Return true if the buffer has overflowed and data has been lost.
Read an array of short data from sample.
|Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SampleQueueInputStream(SynthSampleQueue queue,
public void start(int time)
start in class
public boolean getOverflowed()
- Return true if the buffer has overflowed and data has been lost.
To prevent this, use a larger buffer, or read the data more often.
public int read(short data,
- Read an array of short data from sample.
If there is not enough data available, block until all of the data can be read.
To avoid blocking, call available() first to see how much can be read without blocking.
data - Array of shorts containing PCM sample data
offset - index of array to start reading data from
numFrames - number of frames to read from sample
- number of frames read