Help monitoring output levels

Hey, I need some help understanding how to monitor the output level of an event instance. I’ve looked around and ended up with this function, which compiles and executes, but only outputs 0.0. I’m writing this code using the Unreal Engine FMOD API.

float UAudioFunctions::GetOutputLevel(FFMODEventInstance instance)
{
	FMOD::ChannelGroup* group;
	FMOD::DSP* dsp;
	FMOD_DSP_METERING_INFO* input = new FMOD_DSP_METERING_INFO();
	FMOD_DSP_METERING_INFO* output = new FMOD_DSP_METERING_INFO();
	
	instance.Instance->getChannelGroup(&group);
	group->getDSP(0, &dsp);
	dsp->getMeteringInfo(input, output);

	return output->rmslevel[0];
}

I also made this function which I call on the same EventInstance beforehand:

void UAudioFunctions::SetChannelGroupMeteringEnabled(FFMODEventInstance instance, bool isEnabled)
{
	FMOD::ChannelGroup* group;
	FMOD::DSP* dsp;
	
	instance.Instance->getChannelGroup(&group);
	group->getDSP(0, &dsp);
	dsp->setMeteringEnabled(false, isEnabled);
}

I’ve tried looking for answers, but I can only find vague half-answers. What is a channel group? What is a DSP? Why do I need to get the DSP head? What is the DSP head? Why are there 32 “channels” in the rmslevel and peaklevel of the DSP’s meteringinfo, and what do each of them represent?

I’m just hopelessly lost and honestly have no idea what I’m doing or how to accomplish what I want. I just need to be able to monitor the volume/amplitude levels of the event while it’s playing for animation purposes. Any number between a predictable range that matches how loud the playing EventInstance is at any given time will work for me. Please help!

You should probably start here https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-terminology.html
and maybe here
https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-dsp-architecture.html

Thanks, that helps a little bit with some of the terminology. I’m still lost on the API, though. Still feel like I have no idea what I’m doing, and I don’t know what I’m doing wrong in terms of getting metering info from the EventInstance.

Hi ,
Your code looks about right but I cant see what would be happening in your code that might be causing a problem. You can try checking all error codes from fmod functions.

I’ve looked more into it and came upon a potential issue.

Detailed it in a new question here: