# Unity: getVolume only returning a value of 1?

**URL:** <https://qa.fmod.com/t/unity-getvolume-only-returning-a-value-of-1/20128>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [April 18, 2023, 7:26am UTC](https://qa.fmod.com/t/unity-getvolume-only-returning-a-value-of-1/20128 "2023-04-18T07:26:12Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 19, 2023, 4:32am UTC](https://qa.fmod.com/t/unity-getvolume-only-returning-a-value-of-1/20128/6 "2023-04-19T04:32:36Z")

</div>

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:

1. Get the Bus’ underlying ChannelGroup with [`Studio::Bus::getChannelGroup`](https://www.fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_getchannelgroup)
2. Get one of the DSP units in the ChanneGroup’s DSP chain with [`ChannelControl::getDSP`](https://www.fmod.com/docs/2.02/api/core-api-channelcontrol.html#channelcontrol_getdsp) - typically [`FMOD_DSP_INDEX_HEAD`](https://www.fmod.com/docs/2.02/api/core-api-channelcontrol.html#fmod_channelcontrol_dsp_index), which is the closest in proximity to the Bus’ output
3. Enable metering for the DSP with [`DSP::setMeteringEnabled`](https://www.fmod.com/docs/2.02/api/core-api-dsp.html#dsp_setmeteringenabled)
4. Retrieve the metering info from the DSP with [`DSP::getMeteringInfo`](https://www.fmod.com/docs/2.02/api/core-api-dsp.html#dsp_getmeteringinfo)

A couple things to keep in mind:

1. A Bus may not be active when you try to retrieve its ChannelGroup, so you’ll want to make sure that [`Studio::Bus::getChannelGroup`](https://www.fmod.com/docs/2.02/api/studio-api-bus.html#studio_bus_getchannelgroup) returns `FMOD.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.
2. The [`FMOD_DSP_METERING_INFO`](https://www.fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_metering_info) struct has float arrays of peak/RMS channel levels, but only the first `numchannels` amount of elements in the array are relevant.

Hope this helps!

---

_[View the full topic](https://qa.fmod.com/t/unity-getvolume-only-returning-a-value-of-1/20128)._
