Lua Source Script to either Mute if Unmuted or Unmute if Muted, or set volume for a selected Audio Source when the scene becomes active in the stream and optionally replaces the prior Mute state or volume of the selected Audio Source when the scene is no longer active in the stream.
Load the "automute-duck.lua" script then add an " Auto Mute/Duck Audio" source to the scene. In that new source's properties select the Audio Source to Mute/Unmute or duck. Default is to mute the selected audio source when active. Check the Unmute if Muted box to unmute instead, or the Duck Volume instead of Mute option to change volume. Select the Restore option if desired.
Because OBS loads a new source before removing an old source, the new version will ignore the restore option if the new scene is modifying the same audio source with this script.
NOTE: The Auto Mute/Duck Audio source that is added to the scene will be renamed to a descriptive title such as --> (1) Desktop Audio Vol set to 29 (-17.6 db) or (2) UnMute: Video Capture Device
Load the "automute-duck.lua" script then add an " Auto Mute/Duck Audio" source to the scene. In that new source's properties select the Audio Source to Mute/Unmute or duck. Default is to mute the selected audio source when active. Check the Unmute if Muted box to unmute instead, or the Duck Volume instead of Mute option to change volume. Select the Restore option if desired.
Because OBS loads a new source before removing an old source, the new version will ignore the restore option if the new scene is modifying the same audio source with this script.
NOTE: The Auto Mute/Duck Audio source that is added to the scene will be renamed to a descriptive title such as --> (1) Desktop Audio Vol set to 29 (-17.6 db) or (2) UnMute: Video Capture Device