# \[iOS\] Simple way of getting output power?

**URL:** <https://qa.fmod.com/t/ios-simple-way-of-getting-output-power/11423>\
**Category:** FMOD Studio\
**Created:** [April 23, 2014, 4:55pm UTC](https://qa.fmod.com/t/ios-simple-way-of-getting-output-power/11423 "2014-04-23T16:55:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prehensile](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@prehensile](https://qa.fmod.com/u/prehensile)\
**Post date:** [April 23, 2014, 4:55pm UTC](https://qa.fmod.com/t/ios-simple-way-of-getting-output-power/11423/1 "2014-04-23T16:55:35Z")

</div>

Hello all,

I’m trying to figure out a simple way of getting overall output power / loudness from the FMOD system. Basically, value from 0.0 to 1.0, where 0.0 is nothing-at-all-super-quiet and 1.0 is THE LOUDEST.

I’ve got as far as poking at brett’s code samples in [this thread](http://www.fmod.org/forum/viewtopic.php?f=21&t=18741&p=58836), but it seems like getting a full FFT and then averaging the values out is a bit of a waste of CPU, going around the houses to get a simple value.

Is there a better way to get this? I’m open to pulling it out of iOS somewhere further along the chain from FMOD; FMOD outputs to an AudioUnit, right?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [April 24, 2014, 1:37am UTC](https://qa.fmod.com/t/ios-simple-way-of-getting-output-power/11423/2 "2014-04-24T01:37:26Z")

</div>

Perhaps something like this

```auto
// Get the master channel group
FMOD::ChannelGroup* master;
system->getMasterChannelGroup(&master);

// Get the DSP unit that is at the head of the DSP chain of the master channel group
FMOD::DSP* masterHead;
master->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &masterHead);
// enable output metering
masterHead->setMeteringEnabled(false, true);

// Call this at regular intervals to fetch the output meter
FMOD_DSP_METERING_INFO outputmeter = {};
masterHead->getMeteringInfo(0, &outputmeter);

// stereo on iOS
assert(outputmeter.numchannels == 2);
printf("Power over the last %d samples: left = %f, right = %f \n", outputmeter.numsamples, outputmeter.rmslevel[0], outputmeter.rmslevel[1]);
```
