Reputation: 249
I am creating a convolution reverb plugin using Juce and I am having some trouble loading in the impulse response audio files.
I am using the AudioFormatReader Class. Here is the code I have implemented so far which is producing some errors:
std::ifstream irStream;
irStream.open("1 Halls 01 Large Hall L.wav");
AudioFormatReader(juce::InputStream irStream, const juce::String &WavAudioFormat);
This is just an attempt at loading one audio file, ultimately I would like many.
Here is a link to the AudioFormatReader Class documentation:
Upvotes: 1
Views: 654
Reputation: 8220
You can use AudioFormat::createReaderFor for this (note that this is pure virtual function, and you'll have to use one if its derived types such as WavAudioFormat) alongside File. For example...
File myFile ("myFile.wav");
AudioFormatReader* myFormatReader = WavAudioFormat().createReaderFor (myFile.createInputStream(), true);
Upvotes: 1