# How do I know the output level in dB?

**URL:** https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904
**Category:** FMOD Engine
**Tags:** cpp
**Created:** [March 18, 2021, 8:45pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904 "2021-03-18T20:45:21Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [March 18, 2021, 8:45pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/1 "2021-03-18T20:45:21Z")

</div>

I’m trying to see if a certain channel peaked using **FMOD\_DSP\_METERING\_INFO.peaklevel**.  
If its unit was dB, I could just check if it’s greater than 0.

Also, can **FMOD\_ChannelGroup\_GetAudibility()** be used for this purpose?

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [March 25, 2021, 12:17am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/2 "2021-03-25T00:17:26Z")

</div>

Audibility is measured in linear volume, not dB and it’s based on any significant modifiers of the output volume. It doesn’t look at the actual samples of the signal, just things affecting them, like faders.

Instead, you should be able to use the FMOD\_DSP\_TYPE\_LOUDNESS\_METER in order to measure the actual peak of a signal.

[https://www.fmod.com/resources/documentation-api?version=2.0&page=core-api-common-dsp-effects.html#fmod\_dsp\_type](https://www.fmod.com/resources/documentation-api?version=2.0&page=core-api-common-dsp-effects.html#fmod_dsp_type)

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [March 25, 2021, 8:30am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/3 "2021-03-25T08:30:09Z")

</div>

Is that a public API we can use?  
I searched here before asking my question.  
The reason why I was testing **FMOD\_DSP\_METERING\_INFO** and **FMOD\_ChannelGroup\_GetAudibility()** was, I thought we couldn’t use FMOD\_DSP\_TYPE\_LOUDNESS\_METER after reading [this](https://qa.fmod.com/t/getting-volume-from-a-recorded-sound-programmatically/11746/2) and [this](https://qa.fmod.com/t/fmod-dsp-metering-info-units/12615/4) answers from your team.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [March 25, 2021, 8:45am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/4 "2021-03-25T08:45:11Z")

</div>

Do you mean I can use FMOD\_DSP\_GetMeteringInfo() with FMOD\_DSP\_TYPE\_LOUDNESS\_METER?  
It seems there’s no other public function that can retrieve a value from FMOD\_DSP\_TYPE\_LOUDNESS\_METER…

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [March 31, 2021, 10:00pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/5 "2021-03-31T22:00:25Z")

</div>

Really, nobody from the FMOD team knows about this?

---

<div class="post-metadata">

### Author: ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)
#### Post date: [April 1, 2021, 3:57am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/6 "2021-04-01T03:57:20Z")

</div>

My apologies for the delay. We have been discussing internally and have scoped in making DSP\_LOUDNESSMETER\_INFO public for an upcoming release. It won’t be in the next release but hopefully for the release after. In the meantime you can convert the linear volume into dB.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [April 1, 2021, 4:32am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/7 "2021-04-01T04:32:42Z")

</div>

> “We have been discussing internally and have scoped in making DSP\_LOUDNESSMETER\_INFO public for an upcoming release.”

Honestly, I didn’t expect this. Great to hear the news and thanks a lot to you and your team!

> “you can convert the linear volume into dB.”

In fact, this was my initial question. I thought there was some way to convert the linear value.  
But how? Could you at least give me a hint?

Update: Is this a correct way to get a volume in dB?  
float db = 10.0f\*logf(lin \> 0.99f ? 0.01f : 1.0f - lin);

Update2: It seems like the correct answer is this…?  
db = 20 \* log10(lin)

---

<div class="post-metadata">

### Author: ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)
#### Post date: [April 4, 2021, 1:33pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/8 "2021-04-04T13:33:04Z")

</div>

> [@jiyongman](#):
>
> db = 20 \* log10(lin)

I rather find `dB = 6 * ln(lin) / ln(2)` but it seems to give almost the same result. I’m not math savvy enough to explain why, though!

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [April 5, 2021, 11:27am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/9 "2021-04-05T11:27:30Z")

</div>

I got some equations after searching here for hours, and the last one was the most mentioned expression by many developers including the former FMOD team member.  
And if your way also returns a similar result, then I think both can be used.  
Thanks.

---

<div class="post-metadata">

### Author: ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)
#### Post date: [April 5, 2021, 11:45am UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/10 "2021-04-05T11:45:05Z")

</div>

My formula comes from the resolution of those hypothesis:  
\*2 lin = +6 dB  
0 dB = 1 lin  
Not sure what’s the logic behind the other formula.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [April 5, 2021, 1:22pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/11 "2021-04-05T13:22:32Z")

</div>

This can help you

> **[Decibel (dB) to Float Value Calculator – Making Sense of Linear Values in...](http://www.playdotsound.com/portfolio-item/decibel-db-to-float-value-calculator-making-sense-of-linear-values-in-audio-tools/?c=10)**
>
> TYPE IN YOUR VALUES TO THE BOXES BELOW \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ dB value to Float Value Converter (Type -100 dBFS to 0 dBFS) Linear Value Equivalent \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Linear to d…

---

<div class="post-metadata">

### Author: ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)
#### Post date: [April 5, 2021, 2:23pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/13 "2021-04-05T14:23:49Z")

</div>

`20 * log(lin)` is an approximation, `6 * ln(lin) / ln(2)` is the exact formula.  
Check lin = 0.5, the first one gives -6.0206 dB, while the second gives exactly -6 dB.

---

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [April 6, 2021, 1:32pm UTC](https://qa.fmod.com/t/how-do-i-know-the-output-level-in-db/16904/14 "2021-04-06T13:32:11Z")

</div>

Checked  
The reverse is also true:

> lin = 10^(db / 6 \* log(2))

Thanks!
