I am writing a simple 4-band equalizer. However, I keep getting this error. Am I correct in understanding that I need to process each channel as mono, and then it will work correctly? If not, I apologize for being persistent, but could you please point out what might be the issue? I’ll finish the rest myself. Thank you.
void EQAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
juce::ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
updateFilters();
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
juce::dsp::AudioBlock<float> block (buffer);
filterChain.process(juce::dsp::ProcessContextReplacing<float>(block));
}
// This class can only process mono signals. Use the ProcessorDuplicator class
// to apply this filter on a multi-channel audio stream.
jassert (inputBlock.getNumChannels() == 1); <===============
com.apple.audio.IOThread.client (9): EXC_BREAKPOINT (code=1, subcode=0x1003e3e08)
jassert (outputBlock.getNumChannels() == 1);
Hi, yes you should create a MonoChain for each Chanel so for ex: CustomChain leftChain, rightChain;. You need to update the filters for both of them since they both are their own objects.
It’s kinda hard to see what the problem is since you didn’t post the output of the issue but rather the code where the issue occured. Please also post the error output.
So, as I understand it, to support mono and stereo, I need to process the left mono and right mono channels separately. Unfortunately, I’m still in the process of learning the framework, so I’ll share the working code once I manage to get something done.