Page 1 of 1

VMRAPI gives different level value than VM alone?

Posted: Wed Mar 31, 2021 7:11 pm
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.

Re: VMRAPI gives different level value than VM alone?

Posted: Wed Mar 31, 2021 7:50 pm
by Vincent Burel
dB = 20x LOG10 (level)

Re: VMRAPI gives different level value than VM alone?

Posted: Wed Mar 31, 2021 8:10 pm
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)

Re: VMRAPI gives different level value than VM alone?

Posted: Fri Apr 02, 2021 5:43 pm
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