Resource icon

Automatic Mute 2023-01-04

aaronfulton

New Member
aaronfulton submitted a new resource:

Automatic Mute - Automatically mute an audio sources when switching scenes

OBS script for muting/unmuting audio sources when specific scenes are transitioned to/from.

Up to 20 scenes can be selected and one audio source.

This is exceptionally useful if you want to mute/unmute a microphone when transitioning to/from a video

Usage
  • Download this script to a safe location on your OBS PC
  • In OBS go to Tools >> Scripts
  • Choose this script
  • Choose the audio source which should be muted/unmuted
  • Choose one or more scenes that...

Read more about this resource...
 

kvzonbr

New Member
Hey man thanks for the script really helped me works great with auto changing scenes.

I changed the 20 scenes limit, to detect your scenes and makes them the limit on menus, .... "if you have 5 scenes will show you 5 drop down menus, if you have 30 will show them, and so on, hope it helps

best regards
 

Attachments

  • mute-unmute.lua.zip
    1.8 KB · Views: 123

aaronfulton

New Member
Hey man thanks for the script really helped me works great with auto changing scenes.

I changed the 20 scenes limit, to detect your scenes and makes them the limit on menus, .... "if you have 5 scenes will show you 5 drop down menus, if you have 30 will show them, and so on, hope it helps

best regards
Thanks kvzonbr, I wanted to do this initially but could not work out how. I've updated the plugin using your code. :-)
 

ItsJohann98

New Member
Script Update
Hello, I have updated the script.

-Increased the audio device selection to 3.
-Limited the scene selection to 5.
-Fixed the bug where the script was not functioning properly after an OBS restart.
-Fixed the bug where the scene selection was not being displayed after an OBS restart.



To fix the problem, I have limited the scenes to 5 and expanded the audio devices to 3 for multi-microphone users.
The list is loaded correctly due to the limit after a restart.
To automatically update the script after an OBS restart, I have implemented 2 script restart functions to ensure that the script functions correctly at all times.
To use the restart function, the script must be saved under C:\scripts\mute_unmute_script.lua

If you encounter any further bugs, please feel free to reach out to me.
I can keep the script up to date.
 

Attachments

  • mute_unmute_script.zip
    2.1 KB · Views: 61

Gert

New Member
I'm using the "Media Source" source used to capture an RTSP stream, unfortunately it does not show up in the drop down menu as one of the possible sources for the script. Any suggestions?
 

Attachments

  • question.png
    question.png
    160.6 KB · Views: 27

Gert

New Member
I'm using the "Media Source" source used to capture an RTSP stream, unfortunately it does not show up in the drop down menu as one of the possible sources for the script. Any suggestions?
1. Workaround: I commented out the 'if' that tests for Wasapi sources to basically add all sources. This works for muting Media Sources, it might cause crashes to sources which do not support obs_source_set_muted (if that exists, anyone?).
2. I fixed a bug in the code that goes through the scene menu list when there is a scene change event. In certain scenarios, jumping from one muted scene to another muted scene would unmute the source.
 

Attachments

  • obs-mute-main_fix.zip
    8.6 KB · Views: 22

Gert

New Member
The get_source_by_name function does not properly clear sources variable. source_list_release has to be used on obs_enum_sources, but nowhere present.
 
Top