커뮤니티 Q&A

Audiokinetic의 커뮤니티 Q&A 포럼에 오신 것을 환영합니다. 이 포럼은 Wwise와 Strata 사용자들이 서로 도움을 주는 곳입니다. Audiokinetic의 직접적인 도움을 얻으려면 지원 티켓 페이지를 사용하세요. 버그를 보고하려면 Audiokinetic 런처에서 Bug Report 옵션을 사용하세요. (Q&A 포럼에 제출된 버그 보고는 거절됩니다. 전용 Bug Report 시스템을 사용하면 보고 내용이 담당자에게 정확히 전달되어 문제 해결 가능성이 크게 높아집니다.)<segment 6493>

빠르고 정확한 답변을 얻으려면 질문을 올릴 때 다음 팁을 참고하세요.

  • 구체적인 내용을 적어주세요: 무엇을 하려는지, 혹은 어떤 특정 문제에 부딪혔는지 설명하세요.
  • 핵심 정보를 포함하세요: Wwise와 게임 엔진 버전, 운영체제 등 관련 정보를 함께 제공하세요.
  • 시도한 방법들을 알려주세요: 문제 해결을 위해 이미 어떤 단계를 시도해봤는지 설명해주세요.
  • 객관적인 사실에 초점을 맞추세요: 문제의 기술적 사실을 중심으로 설명하세요. 문제에 집중할수록 다른 사람들이 더 빠르게 해결책을 찾을 수 있습니다.

0 투표

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);
    }
}
General Discussion Leo V. (140 포인트) 로 부터

1 답변

+1 투표
 
우수 답변

Hi Leo,

I wouldn't recommend following my tutorials anymore, as they target Wwise 2019 and Unreal Engine 4, and many code conventions and workflows have changed.

As mentioned in the Unreal Engine C++ Projects documentation page:

Note:
You must use the WwiseSoundEngine module's IWwiseSoundEngineAPI interface for all AK::SoundEngine calls.

In practice, this means you'd have to replace your current code in the Tick function with:

if (auto* SoundEngine = IWwiseSoundEngineAPI::Get())
{
    if (PlayingID != AK_INVALID_PLAYING_ID)
    {
        AkTimeMs CurrentPositionMs = 0;
        SoundEngine->GetSourcePlayPosition(PlayingID, &CurrentPositionMs, true);
    }
}

You'll need to include "Wwise/API/WwiseSoundEngineAPI.h" for this to work.


Trying to post the event on this actor will still fail with the warning:

LogAkAudio: Warning: Failed to post AkAudioEvent 'MyAwesomeEvent' with an actor that doesn't have an AkComponent on Root.

To avoid this issue and properly hear the event you have posted, add an Ak Component to this actor in the Details tab of the Unreal Inspector while the actor is selected.

Alessandro Famà (4.5k 포인트) 로 부터
선택됨 Leo V. 로 부터
Hi Alessandro,

Thanks for the informative reply, I've got it working now - hopefully this post helps anyone else who skims through documentation :)
...