Download

How to use AudioCaptureComponent in C++

Hello.
Tried to use this component with c++, but editor is get crashed every time I activate component or handle any its event.
So, I think, something is not initialized, but I don’t get what exactly.

Build.cs:
PublicDependencyModuleNames.AddRange(new string] { “Core”, “CoreUObject”, “Engine”, “InputCore”, “HeadMountedDisplay”, “AudioCapture” });
PrivateDependencyModuleNames.AddRange(new string] { “AudioCapture” });

.h:
/capture mic/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = “true”))
class UAudioCaptureComponent* MicCapture;

.cpp:

#include “AudioCaptureComponent.h”

AAudioCaptureCheckingCharacter::AAudioCaptureCheckingCharacter()
{


MicCapture = CreateDefaultSubobject<UAudioCaptureComponent>(TEXT(“MicCapture”));
MicCapture->SetupAttachment(RootComponent);
}