Hey guys, I’m stuck with mixing together 2 audio buffers.
I have a plugin that should play a soundfile on top of what is coming from the input channels.
I start by duplicating the input Buffer. then adding the soundfile to the actual buffer.
Now I’m stuck. However I try to mix the two buffers together the input is still muted.
void PomodoroAudioProcessor::processBlock(AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
ScopedNoDenormals noDenormals;
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
const int numSamples = buffer.getNumSamples();
AudioBuffer<float>& inputBuffer = buffer;
transportSource.getNextAudioBlock(AudioSourceChannelInfo(buffer));
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
auto* channelData = buffer.getWritePointer(channel);
// ..do something to the data...
for(int i=0; i<numSamples; i++)
{
if (muteBreakButtonState && isBreak) { // if mute is enabled on break
channelData[i] = 0;
}
}
}
}
Thanks!
