C++ Audio Component issue

Hi, I want to play a sound when left mouse button is clicked and then stop when it’s released. I did it like this:

static ConstructorHelpers::FObjectFinder<USoundWave> sound(TEXT("/Game/Sounds/Sound"));
    gunSound = CreateDefaultSubobject<UAudioComponent>(TEXT("GunSound"));
gunSound->SetupAttachment(RootComponent);
gunSound->Activate();
if (sound.Succeeded())
{
	gunSound->SetSound(sound.Object);
	gunSound->SetRelativeLocation(FVector(0.f, 0.f, 0.f));
	gunSound->SetRelativeScale3D(FVector(1.f, 1.f, 1.f));
	UE_LOG(LogTemp, Warning, TEXT("loaded sound"));
	gunSound->Stop();
}

but It always throws an exception when I want do Play(). Since I can’t find it anywhere I’m asking here. Thank you in advance for any answers.

In my experience using AudioComponent->Stop(); isn’t what you want to do stop will stop the sound from playing again after I found this out in my fire method I use AudioComponent->SetPaused(false) when I want to use it and set it true when I don’t although I also seem to have issues with if statements before any AudioComponent-> it seems to fire no matter what is above it also will fire within a method that hasn’t been called yet