All the tutorials and examples of AudioProcessor I find use PluginEditor to launch the AudioProcessor. What if I want to use no gui at all and just play an audio processor?
For example:
HelloSamplerAudioProcessor::HelloSamplerAudioProcessor()
: AudioProcessor (BusesProperties()
.withOutput("Output", juce::AudioChannelSet::stereo(), true)
I’m plugigng this to an AudioDeviceManager
like this:
auto samplerProcessor = std::make_shared<HelloSamplerAudioProcessor>();
auto samplerProcessorPlayer = std::make_shared<juce::AudioProcessorPlayer>();
samplerProcessorPlayer->setProcessor (samplerProcessor.get());
deviceManager.addAudioCallback (samplerProcessorPlayer.get());
however since it has no inputs, I get
I/JUCE: JUCE Assertion failure in juce_AudioProcessor.cpp:200
I/JUCE: JUCE Assertion failure in juce_AudioProcessor.cpp:350
I/JUCE: JUCE Assertion failure in juce_AudioProcessor.cpp:356
JUCE Assertion failure in juce_AudioProcessor.cpp:360
I/JUCE: JUCE Assertion failure in juce_AudioProcessor.cpp:363
which are from here:
void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double newSampleRate, int newBlockSize)
{
bool success = true;
if (getTotalNumInputChannels() != newNumIns)
success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));
// failed to find a compatible input configuration
jassert (success);
if (getTotalNumOutputChannels() != newNumOuts)
success &= setChannelLayoutOfBus (false, 0, AudioChannelSet::canonicalChannelSet (newNumOuts));
// failed to find a compatible output configuration
jassert (success);
// if the user is using this method then they do not want any side-buses or aux outputs
success &= disableNonMainBuses();
jassert (success);
// the processor may not support this arrangement at all
jassert (success && newNumIns == getTotalNumInputChannels() && newNumOuts == getTotalNumOutputChannels());
setRateAndBufferSizeDetails (newSampleRate, newBlockSize);
ignoreUnused (success);
}
Turns out AudioDeviceManager
calls setPlayConfigDetails
on my processor.
This makes these assertions fail because my processor has no input.
I even tried to give it an input but disable it, but I still get echo.
So, how to I play an audio processor with no input?