Hi everyone,
I'm just getting into programming with UE5 + Wwise 2024.1.1.8691 and can't solve this linker error I get when trying to use GetSourcePlayPosition():
Error CompilerResultsLog WwisePlaybackActor.cpp.obj : error LNK2019: unresolved external symbol "enum AKRESULT __cdecl AK::SoundEngine::GetSourcePlayPosition(unsigned int,int *,bool)" (?GetSourcePlayPosition@SoundEngine@AK@@YA?AW4AKRESULT@@IPEAH_N@Z) referenced in function "public: virtual void __cdecl AWwisePlaybackActor::Tick(float)" (?Tick@AWwisePlaybackActor@@UEAAXM@Z)
Error CompilerResultsLog C:\Users\Leo\Documents\Unreal Projects\Visualiser_Tool\Binaries\Win64\UnrealEditor-Visualiser_Tool-2631.dll : fatal error LNK1120: 1 unresolved externals
I've added EnableGetSourcePlayPosition to AkGameplayTypes.h per this article : https://alessandrofama.com/tutorials/wwise/unreal-engine/playback-position
And I've also used the AK_EnableGetSourcePlayPosition flag. Not sure if the error is related to my implementation of the function or something with my Wwise implementation; posting events works fine.
Any help would be much appreciated, thank you.
Here's my code:
#include "Visualiser_Tool/Public/WwisePlaybackActor.h"
#include "Engine/Engine.h"
#include "Logging/LogMacros.h"
#include "AkGameplayStatics.h"
AWwisePlaybackActor::AWwisePlaybackActor()
{
PrimaryActorTick.bCanEverTick = true;
PlayingID = AK_INVALID_PLAYING_ID;
}
void AWwisePlaybackActor::BeginPlay()
{
Super::BeginPlay();
if (AssignedEvent)
{
FOnAkPostEventCallback nullCallback;
const int32 Flags = AK_EnableGetSourcePlayPosition;
PlayingID = UAkGameplayStatics::PostEvent(AssignedEvent,this,Flags,nullCallback);
}
}
void AWwisePlaybackActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (PlayingID != AK_INVALID_PLAYING_ID)
{
AkTimeMs CurrentPositionMs = 0;
AKRESULT Result = AK::SoundEngine::GetSourcePlayPosition(PlayingID, &CurrentPositionMs, true);
}
}