obsws-ruby/main.rb

19 lines
459 B
Ruby
Raw Normal View History

require "obsws"
2022-10-22 22:30:40 +01:00
2023-07-21 06:37:14 +01:00
class Main
INPUT = "Mic/Aux"
2023-07-21 06:37:14 +01:00
def run
OBSWS::Requests::Client
.new(host: "localhost", port: 4455, password: "strongpassword")
.run do |client|
# Toggle the mute state of your Mic input and print its new mute state
client.toggle_input_mute(INPUT)
resp = client.get_input_mute(INPUT)
puts "Input '#{INPUT}' was set to #{resp.input_muted}"
end
2023-07-21 06:37:14 +01:00
end
2022-10-22 22:30:40 +01:00
end
2023-07-21 06:37:14 +01:00
Main.new.run if $PROGRAM_NAME == __FILE__