[jsyn] SampleQueueInputStream not available()?

jsyn at music.columbia.edu jsyn at music.columbia.edu
Mon Aug 15 23:31:20 EDT 2005


I'm using SampleQueueInputStream, hoping to keep the last 6 seconds of
sample data in memory at all times, periodically grabbing this data as a
short[] for maniuplation at the Java level.  My (working code for this) is

SampleWriter_16F1 writer = new SampleWriter_16F1();
SampleQueueInputStream inStream = new
SampleQueueInputStream(writer.samplePort, (int) (Synth.getFrameRate() *

Where output is the SynthOutput I'm interesting in capturing from.

Later I simply call:

short[] audioData = new short[this.bufferSize];

(where inStream is my SampleQueueInputStream ) to get the short[] data.

This seems to be working except that periodically the SampleQueueInputStream
is not available(), having very few samples in it.

I'm of course hoping that once this "queue" is filled up w/ 6 seconds of
audio, it more or less stays full, dequeueing samples more than 6 seconds
old while enqueueing new ones as they stream in from the SampleWriter and
thus keeping the queue full.  Is this not how this Class works?  Is there
another, better way to achieve this goal using JSyn?

Thanks for any feedback on this,


More information about the JSyn mailing list