We are not able to use AK::SoundEngine::SetRTPCValueByPlayingID without getting an error.
Let me describe the use case:
- Trigger a sound, register for the end of event callback, and keep the playing ID
- Each game frame call AK::SoundEngine::SetRTPCValueByPlayingID to update the RTPC
The callback that will tell us that the sound is finished is being queued by our game engine to be processed on the game thread. Hence, the last time we call AK::SoundEngine::SetRTPCValueByPlayingID we always receive an error that the sound is not playing anymore. The next frame the callback is being processed by the game engine (that was queued), so we eventually stop trying updating the RTPC but one frame too late.
For sure, I could try to not use my system that process the callback on the game thread and do something custom for when I call SetRTPCValueByPlayingID but I find it is a lot of work. Also, I don't care that much to send one extra RPTC value to garbage (this would be better than getting an error each time we use SetRTPCByPlayingID.
Would it be possible to not output an error message when using SetRTPCValueByPlayingID? At least add add a new error type, so we can decide to mute this error in the output log of our game. Is there a way to mute specific errors in the Wwise profiler. If not, that would partially solve our problem.
My current solution to mute the error is to call AK::SoundEngine::Query::GetPlayingIDsFromGameObject prior to AK::SoundEngine::SetRTPCValueByPlayingID, so I can know if the sound has just finished playing or not. However, I don't find the solution optimal.
Also, I was wondering why the SetRTPCValueByPlayingID function is doing a lock to find the game object. AK::SoundEngine::SeekOnEvent doesn't do that and we just pass the game object id.