How to modify with AudioBlock only a channel of AudioBuffer?

Hi, I was trying to get only a channel of an AudioBuffer, then copy it to an AudioBlock with only one channel, applying to this AudioBlock a dsp::DelayLine and finally replace the original AudioBuffer channel with this new AudioBlock processed… how to do it?

dsp::AudioBlock<Type> audioBlock { src->audioBuffer };
dsp::AudioBlock<Type> audioBlockToDelay { audioBlock.getSingleChannelBlock(conn.source.channelIndex) };

delayDsp.delayDsp.process(dsp::ProcessContextReplacing<Type>(audioBlockToDelay));
                        
audioBlockToDelay.copyTo(src->audioBuffer);

doe this make sense? there’s is a better way to do it?

If you want the delay effect on only one channel, you don’t need the last line of code. Cause (in general) AudioBlock does not own data, it directly refers to the original source.

1 Like

Really thank you! :pray: