Version

menu_open
Wwise Unreal Integration Documentation
UE4 C++ projects

Linking with the AkAudio Module

The AkAudio module must be linked with to use Wwise's functionality within a C++ project. This must be done within your project's module file (.build.cs).

For example:

public class MyModule : ModuleRules
{
public MyModule(ReadOnlyTargetRules Target) : base(Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AkAudio" });
// Other settings
}
}
Note:
All AK::SoundEngine calls are currently made from AkAudioDevice and must be made from within the AkAudio module. Users must extend the functionality within the AkAudio module to expose required Wwise functionality.

Creating AkComponent from C++

When creating a new AkComponent from C++, it is necessary to attach it to a parent component. This is necessary, because the FAkAudioDevice::GetAkComponent() helper method needs a parent component to retrieve the associated AkComponent.

auto* AkAudioComponent = CreateDefaultSubobject<UAkComponent>(TEXT("CppCreatedAKComponent"));
AkAudioComponent->SetupAttachment(RootSceneComponent);

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise