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

How to force an ak event to be played as 2D without attenuation or spatialization?

+1 vote

Before we used to set bUseSpatialAudio but this is now marked as deprecated, and I see no other alternative.
The reason we want to do this is so that any events that are out of mistake not set as 2D will be silent in our scenario, and to avoid this from happening and producing very content specific bugs and issues, we want to have a plan B in code that logs the ak event not properly set up, as well as forcing it to be 2D so that it just works in the meantime.

Is this possible?
asked Jul 9, 2020 in General Discussion by Arcade B. (160 points)

1 Answer

+1 vote
You could post the event with a dummy Game Object. In Unreal Wwise integration, there's one registered already called DUMMY_GAMEOBJ.

If you're not using that, you could register your own.

const AkGameObjectID DummyGameObject = 1;

Wherever you Init your Audio engine stuff:

    //// Register the dummy game object. It is used for the 2D sound (UI etc...).
    AK::SoundEngine::RegisterGameObj(DummyGameObject, "Global");


If that doesn't work, you could set the scaling factor to 0

    AK::SoundEngine::SetScalingFactor(DummyGameObject, 0.0f);


The when you want to play the event in 2D, you can call PostEvent with the DummyGameObject instead of whatever object you'd normally use.
answered Jun 30, 2022 by Eric C. (310 points)