Rank: Advanced Member
Groups: Registered
Joined: 11/28/2015(UTC) Posts: 184
Thanks: 10 times Was thanked: 32 time(s) in 27 post(s)
|
Hi
I try to set the audio volume thru API.
If I set a value of 50, then the slider moves to 50%. The XML status reports a value of 6.25 If I set a value of 75, then the slider moves to 75%. The XML status reports a value of 31.6
My final goal is to have a script which reads out current volume, set volume to 0 and fade in until the saved value is reached. But because there are different scales it's not that easy.
So it seems there is some math in between. How is the scale handled in XML status?
Regards, Patrick
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,287 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 Location: Bordeaux, France Thanks: 243 times Was thanked: 794 time(s) in 589 post(s)
|
I was intrigued by your post so I dropped an eye on it by curiosity.
When I move the audio fader by hand in vMix, first I see that they are logarithmic. Meaning putting the fader half-way doesn't mean reducing the volume by half. If one puts his mouse over the fader, it shows the percentage.
So I put the fader at 50% (which is close to the top) and check with the API. XML value is 49.756 (close to 50%) Do the same for 25% > XML shows 24.951 Do the same for 0 > XML shows 0
So I think XML is working as one expects. There is no math to do...
Guillaume
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,287 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
@DWAM
is as you describe when using the slider but not when you use the percentage values in a shortcut , then you get what PM wrote
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/28/2015(UTC) Posts: 184
Thanks: 10 times Was thanked: 32 time(s) in 27 post(s)
|
Guillaume, thanks for verifying.
That's right. If you move the fader by hand to 50% (accoring mouse over information), the XML value ist approx. 50.
But if you set the volume with SetVolume and value 50, the slider moves to the middle of the fader. Same for value 25, the slider moves to 1/4 of fader position.
Patrick
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/11/2016(UTC) Posts: 378 Location: Europe Thanks: 23 times Was thanked: 38 time(s) in 32 post(s)
|
pm wrote:Guillaume, thanks for verifying.
That's right. If you move the fader by hand to 50% (accoring mouse over information), the XML value ist approx. 50.
But if you set the volume with SetVolume and value 50, the slider moves to the middle of the fader. Same for value 25, the slider moves to 1/4 of fader position.
Patrick Hi Patrick did you found the solution? same problem here IF setvolume to 70 XLM says 24.01
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/28/2015(UTC) Posts: 184
Thanks: 10 times Was thanked: 32 time(s) in 27 post(s)
|
No, never found a solution for that. Couldn't finish my audio fadein script because of this behaviour.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/28/2015(UTC) Posts: 184
Thanks: 10 times Was thanked: 32 time(s) in 27 post(s)
|
Sorry, have to bump my post.
My audio fade script is still in an unfinished state, because XML value, mouse over info and SetVolume function behaviour don't match.
Is there a chance to get this solved?
Regards, Patrick
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/13/2010(UTC) Posts: 5,153 Location: Gold Coast, Australia Was thanked: 4349 time(s) in 1534 post(s)
|
The Volume level in vMix is linked to amplitude and scales with the following formula:
Volume = 0 to 100 (used for UI volume bars) Amplitude = 0 to 1 (used for API Meter and Volume values) Decibels = 0 dB to -infinity
Volume = (Amplitude ^ 0.25) * 100 Amplitude = (Volume / 100) ^ 4
Example VolumeBar = 50 Amplitude = 0.0625 MeterF = 0.0625 VolumeXML = 6.25
I will leave converting amplitude to decibels as an exercise to the reader.
Regards,
Martin vMix
P.S meter values in XML are in Amplitude 0-1, while volume values in XML are in Amplitude 0-100
|
4 users thanked admin for this useful post.
|
DWAM on 9/26/2017(UTC), doggy on 9/26/2017(UTC), pm on 9/26/2017(UTC), stigaard on 9/26/2017(UTC)
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/20/2015(UTC) Posts: 493 Location: Copenhagen, Denmark Thanks: 398 times Was thanked: 100 time(s) in 79 post(s)
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close