I’m trying to make a wav player plugin.
In order to achieve this, I :
created an audioFormatReader and gave it the wave file;
created an audioSampleBuffer;
resized it to fit the file’s length;
called the readFromAudioReader function
and gave it the reader.
Now, in the processBlock function, I need to copy the samples from the wave buffer into the function’s buffer.
I tried with copyFrom, iterations, nothing!
Can anybody help me?
I’m not so good with dsp stuff!
Yeah, that’s the point.
I need to deal with the processBlock buffer’s size and the wavefile’s size.
I have to write a iteration such as:
int blockSize = buffer.getSampleData(0);
while (–blockSize >=0)
{
copy N samples from wavefile into buffer;
when the last of N samples is reached,
get the next N samples;
repeat until the end of wavefile.
}
where N samples is equal to blockSize.
I think you made something like this in your SamplerVoice::renderNextBlock, Jules.