logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Andrew  
#1 Posted : Friday, August 14, 2020 11:03:29 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Registered
Joined: 6/26/2011(UTC)
Posts: 30
Location: London

Was thanked: 8 time(s) in 4 post(s)
For IFB to vmix callers, I have a script that (amoung other things) changes a vMix callers audio source on press of a streamdeck button.

API.Function("VideoCallAudioSource",X,"BusD")

Then on release of the streamdeck button it switches it again.

API.Function("VideoCallAudioSource",X,"BusA")

This is all well and good when you know the caller will always originate on Bus A.

However I now have a production where they could originate from A or G.

Could someone possibly help me write a script, or point me in the right direction of how to. I know it's possible to call the current state of everything, but it's beyond my ability to save a state, then recall it later. My scripting ability is limited to simply sending functions, and I'm struggling to backwards engineer other similar examples found here on the forums.

Many thanks.

doggy  
#2 Posted : Saturday, August 15, 2020 12:40:00 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,073
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
While i don't use multiple calls and such i'm pretty sure one can check (API XML) the call's BUSses you assigned to it and go from there

Quote:
<input key="***********" number="12" type="VideoCall" title="Call ***" shortTitle="Call ***" state="Running" position="0" duration="0" loop="False" muted="False" volume="100" balance="0" solo="False" audiobusses="A" meterF1="0" meterF2="0">Call guy</input>
Andrew  
#3 Posted : Saturday, August 15, 2020 1:30:47 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Registered
Joined: 6/26/2011(UTC)
Posts: 30
Location: London

Was thanked: 8 time(s) in 4 post(s)
Thanks doggy,

That's excellent, so we know the information is there :)

Now in scripting, how can I call that information, save it in memory somehow, change the bus on button down, then change it back to the previous state on button up!

I appreciate this is relatively specialist knowledge, and I'd be happy to pay someone to write this for me, along with a few other handy scripts I have in mind. Are there people here that offer custom vmix scripting as a service?
Andrew  
#4 Posted : Tuesday, August 18, 2020 1:20:17 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Registered
Joined: 6/26/2011(UTC)
Posts: 30
Location: London

Was thanked: 8 time(s) in 4 post(s)
Success! (Mostly)

Posting for the benefit of others who might need something similar.

Firstly, I have now learnt how to read information from the XML and action based on it, very usefull :)
https://forums.vmix.com/...86-Scripting-for-Dummies
doggy's post is very handy but if you don't know vb.net you need to learn or find a friend who does before you can make any sense of it.

So it turns out you cannot get the information you need from the XML. The "VideoCallAudioSource" is not shown anywhere in the XML, frankly very little output information is available.

In the end I took a different approach. It's prone to error but it's good enough for me for now.

In the specific case of my production I can infer which audio bus they are being sent, by reading other things like whether they are active, or on an overlay, or which audio busses their own audio is being sent to...

I know that if a callers audio is being sent to BusG, they should also be recieving BusG. And if it's being sent to Busses M and A, they should be recieving BusA.

So now I have the streamdeck button down will swap their audio source to my IFB bus as usual.
Then on button up it runs a script to check which bus their audio is being sent to, and changes their return audio accordingly.

Good luck!





doggy  
#5 Posted : Tuesday, August 18, 2020 1:53:26 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,073
Belgium
Location: Belgium

Thanks: 284 times
Was thanked: 920 time(s) in 759 post(s)
Originally Posted by: Andrew Go to Quoted Post

if you don't know vb.net you need to learn or find a friend who does before you can make any sense of it.


True but explaining how to code here would not fit here in the forum.

There are tons of google searches explaining how to code in vb.net , or even c#.net and translate to vb.net

The ability to use scripting with such code did open up a whole world within vMix
banham22  
#6 Posted : Monday, January 11, 2021 11:29:05 AM(UTC)
banham22

Rank: Newbie

Groups: Registered
Joined: 12/1/2020(UTC)
Posts: 2
United Kingdom

Originally Posted by: Andrew Go to Quoted Post
Success! (Mostly)

Posting for the benefit of others who might need something similar.

Firstly, I have now learnt how to read information from the XML and action based on it, very usefull :)
https://forums.vmix.com/...86-Scripting-for-Dummies
doggy's post is very handy but if you don't know vb.net you need to learn or find a friend who does before you can make any sense of it.

So it turns out you cannot get the information you need from the XML. The "VideoCallAudioSource" is not shown anywhere in the XML, frankly very little output information is available.

In the end I took a different approach. It's prone to error but it's good enough for me for now.

In the specific case of my production I can infer which audio bus they are being sent, by reading other things like whether they are active, or on an overlay, or which audio busses their own audio is being sent to...

I know that if a callers audio is being sent to BusG, they should also be recieving BusG. And if it's being sent to Busses M and A, they should be recieving BusA.

So now I have the streamdeck button down will swap their audio source to my IFB bus as usual.
Then on button up it runs a script to check which bus their audio is being sent to, and changes their return audio accordingly.

Good luck!







So glad I have finally found someone who has successfully implemented this! I've been searching the forums for hours trying to find anything remotely similar with little success (probably searching for the wrong thing). I'm just starting out with scripting and im stuck on this one so far. I can understand all the elements. But putting them together is where I'm falling apart!

At the risk of sounding a bit cheeky, Would you be willing to share your final script for me to have a browse through. I just need something to get me on the right track.

Thanks in advance!
TRMaCoy  
#7 Posted : Sunday, February 21, 2021 10:14:05 AM(UTC)
TRMaCoy

Rank: Member

Groups: Registered
Joined: 8/7/2020(UTC)
Posts: 14
United States
Location: Philadelphia

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Add one more in this exact situation. Figured I'd share what I have so far in case you're still looking:

Quote:

dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

dim call01 as string = ""
call01 = (x.SelectSingleNode("//input[@title='Call_01']/@audiobusses").Value)

If call01 = "A" Then
API.Function("VideoCallAudioSource",Input:="Call_01",Value:="BusA")

Else
API.Function("VideoCallAudioSource",Input:="Call_01",Value:="BusG")

End If


To see how it works, add a Video Call, name it Call_01. Then run the script and you'll see different actions based on whether Audio Bus A on Call_01 is turned on or off; if A and nothing else is on Call_01 Audio return goes to Bus A. Otherwise it sets to Bus G.

The first block is something to do with pointing the script at the local vMix XML. Someone else is welcome to explain that better than me.
The second block creates a variable named call01, and tells it to dig into the XML and assign it the values of the Call_01 enabled audio buses. Thanks to Doggy for that part.
Third block is your conditional; sub in whatever commands you want to run after the API.Function text. In this case switching the Call_01 Return Bus.

This is probably similar to how Andrew's script worked; since we can't read the VideoCallAudioSource as a variable (at least not easily), I'm using the Audio Bus on the Call as a flag of sorts, given that where it's audio is routed is indicative of where the call is in the show (Green Room, On Deck, or On Air for me). I'm sure there are more elegant solutions, but this seems to do the trick and I get how it works without having to learn a whole new language ground up.
Andrew  
#8 Posted : Monday, February 22, 2021 11:34:24 AM(UTC)
Andrew

Rank: Advanced Member

Groups: Registered
Joined: 6/26/2011(UTC)
Posts: 30
Location: London

Was thanked: 8 time(s) in 4 post(s)
Sorry Banham I didn't spot your question a month ago.

My script is very similar to TRMaCoy, a few differences.

If you can reference your inputs by keys, do. Otherwise the script will break if you have other video engineers using the preset that don't know not to change the input names!

And a slightly improved check.

Quote:
If call01 = "A"


will only work if the callers audio is only going to A.

Where as

Quote:
If StateOf.IndexOf("A") > -1


Will work if the callers audio is going to A, regardless of any other busses it may or may not be going to.

And finally, I add a short sleep in there because users tend to lift the IFB button before they have quite finished what they are saying, made worse by the delay of vmix very large audio buffer.

Quote:


'IFB Off Script. Is a callers audio going to A or G?

dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

dim StateOf = (x.SelectSingleNode("//input[@key='b4a5e0e2-905e-416c-bd11-2bd3d2be54f5']/@audiobusses").Value)

If StateOf.IndexOf("A") > -1
'Console.WriteLine("Caller Live. Changing source back to A")

Sleep(300)

API.Function("VideoCallAudioSource","b4a5e0e2-905e-416c-bd11-2bd3d2be54f5","BusA")

Else If StateOf.IndexOf("G") > -1
'Console.WriteLine("Caller in GreenRoom. Changing source back to G")

Sleep(300)

API.Function("VideoCallAudioSource","b4a5e0e2-905e-416c-bd11-2bd3d2be54f5","BusG")

End If


Every time I write in a feature that does something like this, I also add a variation of it to a master "CheckAndRefresh" script, so if things ever get out of sync I can run that script to quickly fix it.

Since doing this state saving workaround, I have now taken the method a step further and have hidden inputs that's sole purpose is to save the states of things. Silent wav files I send to audio busses, or even title inputs with text fields. Opened up a lot of possibilities. Good luck :)

Users browsing this topic
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.