First of all I have to admit I’m quite new to this so it’s most likely I’m doing something wrong here
When instantiating an AudioBuffer it seems like it allocates memory already in a way it is correctly aligned to use with PFFFT (16 byte boundary). At least PFFFT is not throwing an error when using it. Am I just lucky?
However I also need a vector of AudioBuffers which I create like this in my class:
std::vector< AudioBuffer<float> > m_FFTBuffer;
Then in my construcor I use this in my member initialisation list:
m_FFTBuffer((oversamplingFactor * 2), AudioBuffer<float>(numChannels, FFTSize)),
Now PFFFT throws an error because the allocated memory is not aligned. Is there an easy way to fix this? Or do I need to push_back AudioBuffers using preallocated memory in my constructor?
p.s. I could also copy it to a single preallocated AudioBuffer before feeding PFFFT, then copy it back - but that doesn’t feel right. What about performance when using AudioBuffer::copyFrom a lot in the processBlock?