Attenuation for 3rd person cammera

Hey! How can I achive the effect described in the video using Unreal? The goal here would be to have a component, that the attenuation is being calculated from. The question is actually more if it’s possible without making changes into fmod source itself? - 17:34 (Listeners part)

1 Like

At the moment it looks like you would have to make some changes to the integration source code. Although I believe it should be just a matter of changing the FMODAudioComponent position to be relative to the listener instead of the absolute world position. You would need to do the calculations, as mentioned in the video, but it should be fairly straight forward to do.

You can attach the UE4 listener to the camera using SetAudioListenerOverride, which is what FMOD uses for the listener position. Then use the player position as the attenuation position to calculate the new position of the sound. In the FMODAudioComponent we use the GetComponentTransform’s location as the position to give to FMOD, you could intercept this and use the new camera relative position instead.

This is something we could look at adding to the integration in the future that could be enabled by a setting.

This is something we could look at adding to the integration in the future that could be enabled by a setting.

Yes, please.

Unreal has SetAudioListenerAttenuationOverride which does exactly this for Unreal’s build in sound system.
Since FMOD already uses SetAudioListenerOverride, it could also just implement the usage of SetAudioListenerAttenuationOverride.

Any chance this feature will be added soon?

I’ve digged into the plugin’s code but found it’s pretty hard to inject properly: there should be 2 different positions – 1st for the listenere, to calculate the 3d effects/stereo/etc, 2nd is purely for the attenuation purposes.

I can’t find how to use these 2 separate positions in the plugin’s code…

p.s. for the context, I’m working on a top-down game where the camera is pretty far from the ground/characters

This is currently scheduled for the July release, rather than doing all the work in the UE4 integration, we have decided to add this functionality to the API and then implement in our integrations.