As I understand normally
getNextAudioBlock is called (or just happen in some way) every
bufferSize/sampleRate second. But I wonder what happens when I call some function (let’s say
getNextAudioBlock. Does application wait until all procedures in
myFunction are executed before next getNextAudioBlock, or everything happens parallel (simultaneously)? I’ve always thought it works in series, one by one.
But I’ve found out there is Timer class. So I started to wondering and analyzing all of that. And I think no matter where I call
startTimer(someTime) it should call
someTime. So to make a sense it should be working parallel to
getNextAudioBlock which has different timing than
someTime. Am I right?
And I wonder is there any way to make parallel processing without Timer class? I want to call
myFunction (for example DFT or some slow FFT) in the
getNextAudioBlock, and be sure that if execution of
myFunction takes more time than
getNextAudioBlock will be executed without any obstacles. But wait…!!! In the next
getNextAudioBlock there is again called
myFunction so there need to be some lags. Am I right? So I can consider to use some trigger that not allow to execute
myFunction until the first call is finished. But still need to be sure all next
getNextAudioBlock need to be executed without any obstacles. How to be sure of that? I thing it’s possible only by ensuring
myFunction will be executed parallel. But how to do that?
I am even not sure if all of that what I am talking about has any sense.
How to deal with that kind of doubts.
I am still learning about C++ and programming at all. And few days ago one friend told me everything in programming (each language) happen linear, he mean all procedures one by one. I think he is wrong, but I am not sure why, and even not sure if I am right
Please help me.