Elektordi / obs-websocket-py

Python library to communicate with an obs-websocket server (for OBS Studio)
MIT License
235 stars 59 forks source link

SetMute and ToggleMute in event does not work #54

Closed artemtar closed 3 years ago

artemtar commented 3 years ago

I have checked the same code on switching scenes and it has no issues, muting any source does not seem to work. The snippet connects to obs, print success msg, and does not toggle "myname" in obs. Example:


host = "localhost"
port = 4444
password = "1"

ws = obsws(host, port, password)
ws.connect()

try:
    req = ws.call(requests.ToggleMute("myname"))

ws.disconnect()
Elektordi commented 3 years ago

Forget commit message, wrong issue id, I was talking about #53... :confused:

Elektordi commented 3 years ago

I just tested using master on OSB 26.0.2 and obs-websocket 4.7.0-1, my audio source was muting and unmuting without problem... Just had to remove the try: but I think your code snipped was not full...

Could you check you are using the last versions of obs / websocket / this lib? And could you paste the output of the script, including the success message? But if you are receiving 'ok' from the server and nothing changes in OBS, it may be a bug in the obs-websocker server...

Are you using the lase version of OSB ?

artemtar commented 3 years ago

My bad, somehow I assumed that toggle mute will display or not display the source. Does this toggling display functionality exist?

Elektordi commented 3 years ago

You can try SetSceneItemRender and toggle the render parameter, but you will have to keep the current status on your side... https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md#setsceneitemrender

artemtar commented 3 years ago

Oh, thanks that works!