menu
 

在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。

0 投票

Edit:
I found the problem - inside the PostEventAtLocation stack, at FAkAudioDevice::PostEventAtLocation, line 2319 of the default UE4 integration code, the game object is unregistered, without giving us a chance to set RTPC values on it. Changing this post to feature requests so a variant of the PostEventAtLocation can be made that gives us control over this.
Thanks!

Hello!

How do I use SetRTPCValueByPlayingID? This was my approach and it's erroring:


// Post event (sound plays correctly)
static FString EventName = ""; // Don't know what to pass here
AkPlayingID PlayingID = UAkGameplayStatics::PostEventAtLocation(      // resulting PlayingID is not AK_INVALID_PLAYING_ID
    AudioEvent, // This is a valid UAkAudioEvent* type
    PlayLocation,
    FRotator::ZeroRotator,
    EventName,
    GetWorld()
);

 

// Set RTPC
if (FAkAudioDevice* AudioDevice = FAkAudioDevice::Get())
{
    const bool IsEventsPlayingIDActive = AudioDevice->IsPlayingIDActive(AudioEvent->ShortID, PlayingID);    // IsEventsPlayingIDActive is true

    
    AkRtpcID RTPC_Id = AudioDevice->GetIDFromString(FString("PlayerSpeed"));      // RTPC_Id reads 1493153371 and is not AK_INVALID_RTPC_ID
    AudioDevice->SetRTPCValueByPlayingID(RTPC_Id, My_RTCP_Value, PlayingID, 0);      
// This errors and prints "Unknown game object ID. Make sure the game object is registered before using it and do not use it once it was unregistered.: 2"
}

I don't know what to make of this error, what am I doing wrong? Is this even possible, or do I have to use an AkComponent?


 

分类:Feature Requests | 用户: Vioxtar (370 分)
修改于 用户:Vioxtar

1个回答

0 投票
Hey, just for reference, you can use SpawnAkComponentAtLocation to solve this. It will allow you to set switches or RTPC values on the component, and then fire the event.
用户: Robert K. (140 分)
...