Please be advised that the Audiokinetic offices will close at 3:00 p.m. EST on December 23rd, 2019 for the holiday period, and will reopen on January 3rd, 2020 at 9:00 a.m. EST. Learn more.

Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

I fixed a bug in Wwise UE4 plugin. Can I submit the fix so you can merge it?

+1 vote
I fixed a bug where AkAudioDevice was registering non-local PlayerCameraManagers as default listeners causing multiple issues for listen server players when one or more clients are connected.

I was wondering if there is a public repository to submit a pull request or something so you can merge it in your codebase.

Thank you
asked Nov 14, 2017 in General Discussion by Franco P. (110 points)

1 Answer

0 votes

Hello, this issue was fixed in 2017.1.3 version of the plugin that came out last week.

WG-35104 Fixed: Do not create a listener on a dedicated server.

answered Nov 14, 2017 by Fabien B. (Audiokinetic) (12,240 points)
That fix is not correct as it only solves the problem with dedicated servers but the problem persists with listen servers.

Instead of checking AsPlayerCameraManager->GetWorld()->AllowAudioPlayback() to decide wether you setup a listener or not for that player camera manager, you should check if the player camera manager owning controller is a local controller or not.

void FAkAudioDevice::OnActorSpawned(AActor* SpawnedActor)
    APlayerCameraManager* AsPlayerCameraManager = Cast<APlayerCameraManager>(SpawnedActor);
    if (AsPlayerCameraManager)
        APlayerController* CameraOwner = Cast<APlayerController>(AsPlayerCameraManager->GetOwner());
        if (CameraOwner && CameraOwner->IsLocalPlayerController())
            UAkComponent* pAkComponent = NewObject<UAkComponent>(SpawnedActor);
            if (pAkComponent != nullptr)
                pAkComponent->AttachToComponent(SpawnedActor->GetRootComponent(), FAttachmentTransformRules::KeepWorldTransform, FName());

The actor owner for PlayerCameraManager will always be the owning controller, so you can cast it safely.

This way everything will work as expected. Dedicated servers won't have any listeners. Listen servers will have listeners only for its local players and clients will have listeners only for its local players.
Hey, thanks for the suggestion, I am reopening the issue so that our dev can look at this fix !
I'm happy to help!