To sum it up, you create an inherited class and override the OnGenerateAudio function.
#include "MyCaptureComponent.h"
int32 UMyCaptureComponent::OnGenerateAudio(float* OutAudio, int32 NumSamples)
{
int32 Samples = Super::OnGenerateAudio(OutAudio, NumSamples);
// Do something, for example reduce the amplitude for each sample by a factor of 10
for (int i = 0; i < Samples; i++)
{
OutAudio[i] = OutAudio[i] / 10.f;
}
return Samples;
}
I also found the post on Medium. Do I understand correctly, that If I only want to capture (or modify) these samples there is no real reason for me to create my own version of AudioCapture since I can just add MyCaptureComponent as a subcomponent to the original AudioCapture?