Gotcha. For context, the set/getVolume methods essentially manipulate the fader of the Bus. To get metering info, you have to dig a little deeper into the Core API - you can retrieve it by doing the following:
- Get the Bus’ underlying ChannelGroup with
Studio::Bus::getChannelGroup
- Get one of the DSP units in the ChanneGroup’s DSP chain with
ChannelControl::getDSP
- typicallyFMOD_DSP_INDEX_HEAD
, which is the closest in proximity to the Bus’ output - Enable metering for the DSP with
DSP::setMeteringEnabled
- Retrieve the metering info from the DSP with
DSP::getMeteringInfo
A couple things to keep in mind:
- A Bus may not be active when you try to retrieve its ChannelGroup, so you’ll want to make sure that
Studio::Bus::getChannelGroup
returnsFMOD.RESULT.OK
before doing anything else. This can happen when no events routed to the Bus have been created yet, and you create a new Event routed to the Bus, as the FMOD system will need to update first to create the Bus and Event. - The
FMOD_DSP_METERING_INFO
struct has float arrays of peak/RMS channel levels, but only the firstnumchannels
amount of elements in the array are relevant.
Hope this helps!