FActiveSound issue moving to 4.13

Hi,

I have a little issue with my code now that I have moved to 4.13. before I was using the following line of code to get the owner of an active sound:

AActor* = ActiveSound.GetAudioComponent() ? ActiveSound.GetAudioComponent()->GetOwner() : nullptr;

where ActiveSound is an FActiveSound parameter to a method.

However, the GetAudioComponent() method has now obviously been deprecated, so i am wondering how best to get the owner, as the FActiveSound no longer stores the audio component, but rather an id and a name for the component and the owner as well.

I am not sure how best to use the id and name to get the actual component, and I am assuming I should just use the owner id/name rather than the component since i only actually want the owner anyway.

Any help would be greatly appreciated.

It appears you can now get the audiocomponent as follows:

	UAudioComponent *audioComp = UAudioComponent::GetAudioComponentFromID(ActiveSound.GetAudioComponentID());

Hope that helps,

perfect, thanks a bunch. Do you know if there is a way to use the owner id or name (ie the id or name of an actor) to get the actor directly? as I have these already and seems simpler than getting the component and then using getowner()

Seems though that if this is called from within the audiocomponent (or child class) it causes an assertion since the component is running in the audio thread and GetAudioComponentFromID calls check(IsInGameThread).

So you get…

Assertion failed: IsInGameThread() [File:D:\Build++UE4+Release-4.15+Compile\Sync\Engine\Source\Runtime\Engine\Private\Components\AudioComponent.cpp] [Line: 59] &nl;&nl;

Also, I only see this in the Development_Game build. Is this benign?

What’s the best option to overcome this?