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 .
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();
}
}