# Getting volume at particular position?

**URL:** <https://qa.fmod.com/t/getting-volume-at-particular-position/11418>\
**Category:** FMOD Studio\
**Created:** [April 19, 2014, 8:58pm UTC](https://qa.fmod.com/t/getting-volume-at-particular-position/11418 "2014-04-19T20:58:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dezachu](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Dezachu](https://qa.fmod.com/u/Dezachu)\
**Post date:** [April 19, 2014, 8:58pm UTC](https://qa.fmod.com/t/getting-volume-at-particular-position/11418/1 "2014-04-19T20:58:23Z")

</div>

Hey guys,

New to FMOD and having a great time getting to grips with it.

I’m currently creating a simple demo for my final year project (back to university for my final year in September). I’m trying to set a sprite’s alpha value based off of the volume of one of my samples at that given time. I’ve got 5 sounds running and I’m only interested in the kick loop I’ve got going (running off a standard 4/4 loop, about 160 BMP).

I’ve scoured the API but been unable to find a way to get the channel/sound’s volume at a given position. I know ‘volume’ is the incorrect word, I’m ashamed at myself for not remember the correct one… Hah. Of course the volume is 1.0f unless defined by me otherwise - I’m sure you guys can figure out what I’m referring to :oops: Any pointers would be appreciated, thanks in advance.

---

<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 22, 2014, 3:55am UTC](https://qa.fmod.com/t/getting-volume-at-particular-position/11418/2 "2014-04-22T03:55:16Z")

</div>

If you’re interested in the RMS ([http://en.wikipedia.org/wiki/Root\_mean\_square](http://en.wikipedia.org/wiki/Root_mean_square)) of the signal over the last mix block you can use this code.

```auto
    // After calling playSound() and getting channel back
    FMOD::DSP* channelhead;
    channel->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &channelhead);
    channelhead->setMeteringEnabled(false, true);

    // Call this at regular intervals while the channel is playing
    FMOD_DSP_METERING_INFO outputmeter = {};
    channelhead->getMeteringInfo(0, &outputmeter);
    float alpha = outputmeter.rmslevel[0]; // assume mono
```
