Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes

在UE5 里面尝试获取 当前播放的event 的position ,但是一直获取失败,返回的是AK_PlayingIDNotFound,Wwise 取消Auto Defind SoundBank之后,返回的是AK_NotInitialized

int32 UAkGameplayStatics::GetSourcePlayPosition(int32 PlayingID)
{
    AkTimeMs Position = 0;
    auto Result = AK::SoundEngine::GetSourcePlayPosition((AkPlayingID)PlayingID, &Position);
    if (Result != AKRESULT::AK_Success)
    {
       UE_LOG(LogScript, Warning, TEXT("UAkGameplayStatics::GetSourcePlayPosition: Failed"));
       return Result;
    }  
    else return (int32)Position;
}

这个是我的函数,并且我已经明确传递EnableGetSourcePlayPosition 给事件,以及初始化引擎,初始化返回success

void UWwiseSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
    Super::Initialize(Collection);
    AkMemSettings MemSettings;
    AK::MemoryMgr::GetDefaultSettings(MemSettings);
    AK::MemoryMgr::Init(&MemSettings);

    AkStreamMgrSettings StreamMgrSettings;
    AK::StreamMgr::GetDefaultSettings(StreamMgrSettings);
    AK::StreamMgr::Create(StreamMgrSettings);

    //Init Sound Engine
    AkInitSettings InitSettings;
    AkPlatformInitSettings PlatformInitSettings;
    // 配置初始化设置
    AK::SoundEngine::GetDefaultInitSettings(InitSettings);
    AK::SoundEngine::GetDefaultPlatformInitSettings(PlatformInitSettings);
    AKRESULT Result = AK::SoundEngine::Init(&InitSettings, &PlatformInitSettings);

    GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("Init Sound Engine : %d"), Result));
}

查了很多资料,翻了很文章,都没有说明这里的下一步是什么,怎么修复这里的Bug,所以怎么样才可以通过 Post Event 的Playing 获取当前播放的SFX的 position

in General Discussion by の こと (100 points)

Please sign-in or register to answer this question.

...