exeldro / obs-audio-monitor

audio monitor filter for OBS Studio
GNU General Public License v2.0
282 stars 29 forks source link

Support Push To Talk #37

Open Kryptortio opened 2 years ago

Kryptortio commented 2 years ago

As far as I can tell PTT does not work with this filter (sound still gets passed through). It seem that OBS does not actually mute the source when you have PTT active. So it would be great if this filter checked if PTT is active as well and not only if it's muted.

Edit; found a workaround https://github.com/upgradeQ/obs-filter-hotkeys (with another filter that mutes it). I also coped the third option and created a 4th that toggles off rather than on when a button is pushed)

Additions:

      filter.hotkeys["4;" .. source_name .. ";" .. filter_name] = function(pressed)
        if pressed then
          obs.obs_source_set_enabled(v,false)
        else
          obs.obs_source_set_enabled(v,true)
        end
      end

    elseif k:sub(1,1) == "4" then -- for hold hotkeys which start with 4 symbol 
      filter.hk[k] = obs.obs_hotkey_register_frontend(k, k, function(pressed)
        if pressed then filter.hotkeys[k](true)
        else
          filter.hotkeys[k](false)
        end
      end)
exeldro commented 2 years ago

OBS does not actually mute the source when using PTT and as far as I know there is no way for plugins to know the internal PTT state of a source.

Kryptortio commented 2 years ago

I have never worked with OBS plugins so you probably know better I noticed there is something called "obs_source_push_to_talk_enabled" in the documentation. Another way to do it would be to add keytbindings for the filter itself. Either way the workaround works fine for me so I guess there is no rush to implement a fix for this.