I’m loading a wav file into my plugin using the AudioFormatReader, and reading the whole thing into an AudioSampleBuffer object.
In the processBlock loop I’m iterating through that buffer using a separate variable (which wraps to zero upon reaching the end of the file). I add to the output buffer. This worked, and I celebrated, however…
The wav file playback is too fast - though the sample rate of the file and that of the AudioProcessor/host are both at 44100 Hz.
If anyone has advice on why this may be, I would be grateful.
My code below:
auto* outData = buffer.getWritePointer (channel); auto* wavSamplesToProcess = fileBuffer.getReadPointer(channel);
for(int sample = 0; sample < buffer.getNumSamples(); sample++)
*outData = wavSamplesToProcess[wavSample] ;