2.9 KiB

About

Thanks to the guys at Start Automating it's possible to use this module straight from your Stream Deck.

Requirements

ScriptDeck

Windows Powershell

Powershell core

Note, even though one of them is named Windows they both work on Windows for different powershell versions, see this issue

Voicemeeter API Powershell

How

Once ScriptDeck is installed create a button using Powershell Script, then:

On one button

Due to the design of Voicemeeter's API you may only login/logout once per session so in order to program multiple buttons you must do the following for just ONE button (it can be any button).

Button 1

When Loaded

$global:vmr = Connect-Voicemeeter -Kind "banana"

When Unloaded

Disconnect-Voicemeeter

When Pressed

if ($vmr.strip[0].mute) {
$vmr.bus[0].mute=1
$vmr.bus[1].mute=1
} else {
$vmr.bus[0].mute=0
$vmr.bus[1].mute=0
}

Other buttons

Then your other buttons can have any scripts using the $vmr object:

Button 2

When Pressed

$vmr.strip[1].mute=1
$vmr.strip[2].mute=1

if (-not $vmr.strip[0].mute) {
$vmr.strip[0].mute=1
}

Button 3

When Pressed

$vmr.strip[0].mute=$(-not $vmr.strip[0].mute)
$vmr.strip[1].mute=$(-not $vmr.strip[1].mute)
$vmr.strip[2].mute=$(-not $vmr.strip[2].mute)

Then let's say you have zillions of buttons you want to program, for each Stream Deck window configure ONE button as described above and the other buttons of the same window as described above.

If this explanation is unclear or you'd like me to add some screenshots just ask.

Leveraging Powershell

Since we're now working with Powershell we can do some useful things, for example, lets create a button that interacts with Voicemeeter and OBS:

First make sure you've installed obs-powershell.

Now let's create a button that only toggles some strip mutes if the current OBS scene is "LIVE".

Button

When Loaded

$global:vmr = Connect-Voicemeeter -Kind "banana"

Connect-OBS -WebSocketToken <websocket token>

When Unloaded

Disconnect-Voicemeeter
Disconnect-OBS

When Pressed

$currentScene = $(Get-OBSCurrentProgramScene | Select-Object -ExpandProperty currentProgramSceneName)

if ($currentScene -eq "LIVE") {
$vmr.strip[0].mute=$(-not $vmr.strip[0].mute)
$vmr.strip[1].mute=$(-not $vmr.strip[1].mute)
$vmr.strip[2].mute=$(-not $vmr.strip[2].mute)
}