Fixed wav files gain

Hi everyone,

I’m doing that pluging wich plays multitrack from binary data.
I’m using this method playing it (thanks to daniel) but i can’t figure out how i could attach gain variables there…
Would anybody get a clue ? Thanks a lot!

void FXAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{

	juce::AudioSourceChannelInfo info(&mixBuffer, 0, buffer.getNumSamples());

	newSource->getNextAudioBlock(info);
	for (int c = 0; c < std::min(mixBuffer.getNumChannels(), buffer.getNumChannels()); ++c)
		buffer.addFrom(0, c, mixBuffer.getReadPointer(c), buffer.getNumSamples());

	newSource2->getNextAudioBlock(info); 
	for (int c = 0; c < std::min(mixBuffer.getNumChannels(), buffer.getNumChannels()); ++c)
		buffer.addFrom(0, c, mixBuffer.getReadPointer(c), buffer.getNumSamples());

The addFrom has another parameter which is the gain and defaults to 1.0.
And there is an addFromWithRamp…

1 Like

Thanks a lot!