Controlling OBS from VBA code using OBSCommander.exe

mauian

New Member
I have OBS 30.1.2 on Windows 11.
I use Microsoft Word VBA code to control OBS with OBSCommand.exe. For example, with this Command_ShowSource() I show the source "MyMusic":

Sub Command_ShowSource()

Dim sCommand As String, sMediaSourceName As String

Dim OBSCOMMAND_FILE As String
OBSCOMMAND_FILE = "E:\OBS Studio Portable\OBSCommand_1.6.3\OBSCommand.exe"

sMediaSourceName = "MyMusic" 'media source is an mp3 file

sCommand = Chr(34) & OBSCOMMAND_FILE & Chr(34) & " " & Chr(34) & "/showsource=MyMusic" & Chr(34)
Call Shell(sCommand, 0)

End Sub

Can anyone tell me what is the equivalent code to:

(1) check/uncheck the "Restart playback when source becomes active" for this source?

(2) Issue the commands 'RestartMedia', 'StopMedia', or 'PlayMedia' on this source (while the source is kept always shown)?

Thank you so much!
Mauro
 
Top