How to use resonance audio Room Effects with FMOD in Unreal Engine?

Hello!
I spent many hours to find out but was confused stronger. So, I know, that I should pass some “Room properties” data via the “SetParametrData” function, but i can’t understand how this will be affect sound, and from which instance of which class i should call this… So, I nothing understand :roll_eyes:.

I have c++ file (Actor). For example, it’s a car. This Actor has multiple of UFMODAudioComponents and one UFMODEvent, that sets for each AudioComponent.

My goal is simple. How to use Resonance Room Effects for my FMODAudiocomponent?
I need help. Thanks!

.h

UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FFMODEventInstance InstanceWrapper;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UFMODEvent* Event;

	FMOD::System* pSystem;
	FMOD::ChannelGroup* ChanGroup;
	FMOD::Studio::EventInstance* Instance;
	FMOD::DSP* pDSP;

	FFMODListener Listener;
	FMOD::DSP _listener;

.cpp



                //Begin Play
		FMOD_RESULT result = FMOD::System_Create(&pSystem);

		if (result == FMOD_OK)
		{
			pSystem->init(FMOD_MAX_CHANNEL_WIDTH, FMOD_INIT_NORMAL, NULL);

			pSystem->getMasterChannelGroup(&ChanGroup);
			ChanGroup->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &pDSP);
			pDSP->setActive(true);
			pDSP->setMeteringEnabled(false, true);
			RoomProperties* props = new RoomProperties();
			props->dimensions[0] = 1;
			props->dimensions;
			props->material_names[0] = MaterialName::kMarble;
			props->material_names[1] = MaterialName::kMarble;
			props->material_names[2] = MaterialName::kMarble;
			props->material_names[3] = MaterialName::kMarble;
			props->material_names[4] = MaterialName::kMarble;
			props->material_names[5] = MaterialName::kMarble;
			pDSP->setParameterData(1, props,10);
			Instance = InstanceWrapper.Instance;
		
			
			for (auto var : Audios)
			{
				var->StudioInstance = Instance;
				var->SetEvent(Event);
				var->Play();
			
			}
		}

Another user had a similar question recently and they were kind enough to post the code for how they get to use Resonance and its Room Effects with UE4 and FMOD.

You can also refer to the Resonance Audio documentation for further information, as they are the ones who maintain that plugin and will have the most up-to-date information.

https://resonance-audio.github.io/resonance-audio/reference/fmod/class/fmod-resonance-audio-room.html