[Stk] realtime problem: under-run?

Enrico Costanza enrico.costanza@epfl.ch
Tue, 03 Oct 2006 20:42:45 +0200


Hi All,

I am building a loop based audio sequencer.  It uses WvIn objects for 
the audio clips, wrapped inside a Sampler class I created (Sampler is a 
subclass of .Instrument)

I am experiencing a weird problem.  My sequencer can "wrap around", i.e. 
if an audio clip is longer than the loop, the tail will be simply added 
to the head and played on it. 

I am using RtDuplex to play the result out from the soundcard. 

I hear a "click" (basically the sound seems to go to zero) when the 
"tail" hits the head.  However if I also save the output to a file the 
file is perfect.  The way I do this is by using a WvOut object in 
parallel to the RtDuplex:
StkFloat value = samplerInstance->tick();
rtduplex->tick(value);
waveout->tick(value);

The wave file produced by wvout is perfect. 

Why can this be? And how can I fix this?


Thanks a lot,
Enrico