VMRAPI gives different level value than VM alone?

How to use Voicemeeter Remote API and control Voicemeeter Audio Engine
Post Reply
K4M1s
Posts: 2
Joined: Mon Mar 29, 2021 8:25 pm

VMRAPI gives different level value than VM alone?

Post by K4M1s »

Hello, I'm trying to create simple android app to control Voicemeeter Banana on my PC. I'm using websockets to communicate between my app and Java app on my pc. I've used this wrapper for VMRAPI: https://github.com/mattco98/Voicemeeter-JNA-Interface

The problem i'm facing with is voicemeeter shows different value for level than my app reads from API.
Example:
Image

I'm using this formula to convert value that api gives me:

Code: Select all

lLevel =  Math.max(-80, Math.min(12, 10 * Math.log10(volumeLeft)));
rLevel =  Math.max(-80, Math.min(12, 10 * Math.log10(volumeRight)));
I'm reading data from API like that:

Code: Select all

volumeLeft = Voicemeeter.getLevel(3, (ID * 8));
volumeRight = Voicemeeter.getLevel(3, (ID * 8) + 1);
First parameter is type, I'm using 3 because this is output bus I guess.

Am I supposed to use different formula or type for reading from API?

EDIT: The difference between value that shows Voicemeeter and logged out from my app is not constant.
Vincent Burel
Site Admin
Posts: 2005
Joined: Sun Jan 17, 2010 12:01 pm

Re: VMRAPI gives different level value than VM alone?

Post by Vincent Burel »

dB = 20x LOG10 (level)
K4M1s
Posts: 2
Joined: Mon Mar 29, 2021 8:25 pm

Re: VMRAPI gives different level value than VM alone?

Post by K4M1s »

That seems right, why the wiki says 10log10 then? (I was checking this https://en.wikipedia.org/wiki/Decibel, formula under the table on the right)
Vincent Burel
Site Admin
Posts: 2005
Joined: Sun Jan 17, 2010 12:01 pm

Re: VMRAPI gives different level value than VM alone?

Post by Vincent Burel »

suerly because they are talking about power (watt) not signal level.
and between signal and power there is a square somewhere...

https://vb-audio.pagesperso-orange.fr/f ... ecibel.htm
Post Reply