[Stk] Play.cpp - newbie questions

Gary P. Scavone gary@ccrma.Stanford.EDU
Thu, 26 Jan 2006 11:21:56 -0500


Hi Helena,

You may notice in the main() function, after the dac is instantiated,  
that the "frames" variable (an instance of StkFrames) is resized to a  
length of 'bufferSize' frames.  Based on the return value from the  
RtAudio instance, we know that the callback will always be invoked  
with a request for 'bufferSize' sample frames ... it cannot vary from  
that number.  Thus, in the callback I just perform computations based  
on the size of the 'frames' variable, which is guaranteed to be the  
same length.

Hope that helps.

Regards,

--gary

On 25-Jan-06, at 10:59 PM, Helena Troy wrote:

> Hello,
>
> I recently downloaded the stk; I've built the apps in the 'projects/ 
> exmaples folder,and I''ve been trying to understand how 'play'  
> works.  its been a while since I've written any code - I took some  
> uni level classes in java and c.  I'm afriad I might be asking some  
> real obvious questions, but I've looked on line, checked some  
> books, and I still can't figure some things out.
>
> re- play.cpp
>
> in the tick function
> int tick(char *buffer, int bufferSize, void *dataPointer)
> It looks like the parameter 'bufferSize' is never used in tick() -   
> What's going on here?
>
> in the first try block in main there is the syntax catch (StkError  
> &).  I don't understand how the address of operator can be used in  
> this way.  Isn't it supposed to be before the variable it gives the  
> address of?
>
> thanks ever so much -  I may submit some more questions later,  
> about the tick() callback function.
> Helena
>
>
> _______________________________________________
> Stk mailing list
> Stk@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk