Hi there,
I am fairly new to Juce. I am trying to make a plug-in in which I import an audio file.
I followed the audioplayer tutorial but this is done using the Audio App mode not Plug-in.
I’ve accessed the file like so:
std::unique_ptr<AudioFormatReader> reader (formatManager.createReaderFor (filepath));
And read it to a AudioSampleBuffer object:
fileBuffer.setSize(reader->numChannels, (int) reader->lengthInSamples);
reader->read(&fileBuffer, 0, (int) reader->lengthInSamples, 0, true, true);
I’m not sure what to do next to grab that audio file data in the processBlock method so I can manipulate it (I will be processing it together with audio incoming from my DAW).
Would I say something like:
auto samplesToProcess = fileBuffer.getNumSamples() // my wav file
auto* channelData = buffer.getWritePointer (channel) + sampleToProcess; // DAW audio + wav file
(This didn’t work, but shows my thinking).
Thank you to anyone who points me in the right direction, I am learning how all the components in Juce come together structurally, so am appreciative of corrections of my current misconceptions