# Loudness meter Unreal 4 Integration?

**URL:** <https://qa.fmod.com/t/loudness-meter-unreal-4-integration/14467>\
**Category:** Unreal Engine\
**Created:** [March 21, 2019, 4:10pm UTC](https://qa.fmod.com/t/loudness-meter-unreal-4-integration/14467 "2019-03-21T16:10:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Desenbigh](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@Desenbigh](https://qa.fmod.com/u/Desenbigh)\
**Post date:** [March 21, 2019, 4:10pm UTC](https://qa.fmod.com/t/loudness-meter-unreal-4-integration/14467/1 "2019-03-21T16:10:55Z")

</div>

Hello, how are you fine friends? I was wondering is it at all possible to plug a peak meter in unreal engine 4 with FMOD? I’m trying to make a sound detector display so that depending where the detector is pointed it detects the sound, I’m a developer learning how to program right now. Thank you for your time.

I have an attachment of the example of what I’m trying to recreate (First image) as you can see on the left hand side is a loudness meter which detects sounds depending on the direction you’re facing.

 ![Screenshot_3](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/318e67a20541898bdcc72f91c57901a67bfdb62f.jpeg)

---

<div class="post-metadata">

**Author:** ![Desenbigh](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@Desenbigh](https://qa.fmod.com/u/Desenbigh)\
**Post date:** [March 21, 2019, 9:52pm UTC](https://qa.fmod.com/t/loudness-meter-unreal-4-integration/14467/2 "2019-03-21T21:52:38Z")

</div>

Here is what I have so far in my Unreal project (second Image). I Just need to get the loudness meter working and the camera part is done.

 ![Screenshot_4](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/1X/e81303051eb97aede3ad78c8b8e8437ecfde2297.jpeg)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [March 28, 2019, 3:58am UTC](https://qa.fmod.com/t/loudness-meter-unreal-4-integration/14467/3 "2019-03-28T03:58:14Z")

</div>

You could use the [FMOD\_DSP\_METERING\_INFO](https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html#fmod_dsp_metering_info) to get the levels for each channel.

We do a similar thing in the Unity integration for the debug window.

Here is a sudo code example of what you could do:

```auto
startup
{
    system->getMasterChannelGroup(master)
    master->getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, mixerHead)
    mixerHead->setMeteringEnabled(false, true)
}

game loop
{
    mixerHead.getMeteringInfo(0, outputMetering)
    
    for each (i = outputMetering.numchannels)
    {
        value = outputMetering.rmsLevel[i] * outputMetering.rmsLevel[i]
        // Each channel represents a speaker.
        // Here it is up to you what you do with this information.
        // In Unity we combine all the values to give one overall value.
        // 
    }

    float db = value > 0 ? 20.0f * Log10(value * Sqrt(2.0f)) : -80.0f;
    if (db > 10.0f) db = 10.0f;
}

```

[https://fmod.com/resources/documentation-api?version=2.0&page=core-api-dsp.html#dsp\_getmeteringinfo](https://fmod.com/resources/documentation-api?version=2.0&page=core-api-dsp.html#dsp_getmeteringinfo)
