Get Source/Listener positions in FMOD plugin for UE4

I am using FMOD_UE4_Tutorials_Map in Unreal Engine 4 with FMOD 1.07.07

Similar to the fmod_distance_filter sample plugin provided in the API, I am trying to write my own plugin that gets source/listener position when a 3D event such as grenade explosion takes place.

Is there any way to get this data ?
Also, when is the FMOD_DistanceFilter_dspsetparamdata callback triggered?

Using the distance filter is a good example to start from. The function FMOD_DistanceFilter_dspsetparamdata is part of the FMOD_DSP_DESCRIPTION, so it is called by FMOD when a data parameter is set into the DSP.

If you place the plugin on the master track of an event, and if the DSP has declared a FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES parameter, then FMOD Studio will update the 3d position into the DSP when the emitter or listener moves.

The data type that is passed in is documented here:

It doesn’t provide the listener orientation, but it does have both the absolute and relative position of the emitter (compared to the listener).

If you want to support multiple listeners, you can declare the type FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI instead. Then you will receive this structure passed to the callback:

That structure contains all relative orientation for all listeners.

1 Like

This was very helpful.