Hello I have code that is meant to read an audio file, process it, and then save the processed audio as a .wav file. I am having an issue with that last part. I’m getting an error that says “Call to implicitly-deleted copy constructor of ‘std::unique_ptrjuce::AudioFormatWriter’” and I haven’t been able to find a way around it.
Here is where I initialize the process to save the audio file. This is in the PluginProcesser.h file:
void saveWavFile (juce::File, juce::AudioBuffer<float>, std::unique_ptr<juce::AudioFormatWriter>, juce::WavAudioFormat);
Here is the matching process in the PluginProcessor.cpp file. This is where I’m getting the error.
void BasicFilterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
{
//Declaring variables for the process block.
biquad.setFs(sampleRate);
biquad2.setFs(sampleRate);
//File path of source audio (NEED TO CHANGE TO YOUR LOCAL FILEPATH)
maxiSample.load("/FILEPATH/");
juce::AudioBuffer<float> buffer;
//Delete any file that currently exists to ensure nothing is over-written.
file.deleteFile();
file.create();
//Wav audio format variables
juce::WavAudioFormat format;
std::unique_ptr<juce::AudioFormatWriter> writer;
saveWavFile(file, buffer, writer, format);
}
The saveWavFile process works perfectly and doesn’t have any errors. Unsure why I’m getting the implicitly-deleted copy constructor error. Any help would be appreciated! Been stuck on this for a while now.
