Attenuation for 3rd person cammera


(Krzysztof Siewiorek) #1

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?

http://www.gdcvault.com/play/1022060/How-to-Write-an-Audio - 17:34 (Listeners part)


(Cameron Baron) #2

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.


(Shanyu) #3

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.