Page 1 of 1

Time budget for processing callback buffer

Posted: Fri Jan 27, 2017 7:21 pm
by erik.vanhamme
I have my callback registered and working. My sample rate in the whole chain is 96kHz.

The callback receives buffers with a length of 960. Can I assume that the buffer length will always correspond to a 10ms window?

This would put the upper boundary for processing the buffers at 10 ms. I guess VoiceMeeter itself also requires some time from the 10 ms window. How much time do I have to process a buffer in the callback?

Thanks in advance, Erik

Re: Time budget for processing callback buffer

Posted: Sat Jan 28, 2017 7:11 am
by Vincent Burel
the general DSP rule is that you have the time of the buffer size (count 80% of this time).
and the Voicemeeter Callback Buffer size is given by main stream (output A1) so the buffer size can vary from 128 to 2048 samples according configuration.

Example:
At 96 kHZ if your buffer is 960 samples , you have 10 ms to process these 960 samples
At 48 kHz, if your buffer is 512 samples, you have around 10 ms to process
At 48 kHz, if your buffer is 256 samples, you have around 5 ms to process

if you take more time than the buffering, then you may have a cut in the sound.
(we recommend to not call system function , including synchro function in this callback... for example all allocations / initializations must have been done in start/end step... like with a DSP ).

Re: Time budget for processing callback buffer

Posted: Tue Jan 31, 2017 12:07 am
by erik.vanhamme
Thank you for the clear info. I was able to make a good start on my project this weekend.