Fundamental DSP and Multithreading question
I have sampled audio allocated in memory represented as simple array of floats. Sample count is known and stored in another variable.
In my audio thread I read through and interpolate this audio, even allowing for pitch shifting to occur mid buffer. In other words, I get up close and personal with each discrete sample frame while in the audio thread.
In my main thread, if I want to replace my sampled audio with different audio of different length does anyone have ideas for the best way to handle this, considering my audio thread may still be trying to read the original audio?