在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。
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" }
// 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?