Removing echo when recording from a mic ?

Hello,
I’m trying to record my voice from a mic and save it as a wav file.
I’m using a UAudioCaptureComponent + a USoundSubmix and it works well, i can record and save the audio.
The problem is that while recording, there is some echo.
I found on youtube some tutorials to deal with this, the idea is to create a second USoundSubmix that take its input from the output of the first one, and setting all its volumes to the minimum.
The tutorials on YT are done with blueprints, so i translated the setup in C++ like this:

soundSubmixSilent = CreateDefaultSubobject(TEXT(“soundSubmixSilent”));
soundSubmixSilent->SetSubmixOutputVolume(this, -96.f);
soundSubmixSilent->SetSubmixDryLevel(this, -96.f);
soundSubmixSilent->SetSubmixWetLevel(this, -96.f);

soundSubmixRecord = CreateDefaultSubobject(TEXT(“soundSubmixRecord”));
soundSubmixRecord->SetParentSubmix(soundSubmixSilent);

audioCaptureComponent = CreateDefaultSubobject(TEXT(“audioCaptureComponent”));
audioCaptureComponent->bAutoActivate = false;
audioCaptureComponent->bEnableBaseSubmix = true;
audioCaptureComponent->SoundSubmix = soundSubmixRecord;
audioCaptureComponent->SetSubmixSend(soundSubmixRecord, 1.f);

Unfortunately it doesn’t work: the echo is still there.
Any idea of what i’m missing ?

Thanks
Cedric

I don’t know if this is a solution or a workaround.

I tried everything i could think of, i could even check visually (in the editor) that my chain of C++ submixes was correctly setup, but the echo remained.

So i took a different approach: i just declared one submix in my class as a variable, then created my two submixes directly in the editor, and assigned the first one to my class variable in the BP constructor.
Then it worked.
I can’t see any difference between what i did in C++ and what i did in the editor, but one worked, and the other didn’t.

I still don’t know if it is supposed to work or not.

Cedric

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.