Loudness meter Unreal 4 Integration?

#1

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.

0 Likes

#2

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.

0 Likes

#3

You could use the 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:

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

0 Likes