2023-08-11 14:44:51 +01:00
|
|
|
require "obsws"
|
2022-10-22 22:30:40 +01:00
|
|
|
|
2023-07-21 06:37:14 +01:00
|
|
|
class Main
|
2023-08-11 16:15:17 +01:00
|
|
|
INPUT = "Mic/Aux"
|
|
|
|
|
2023-07-21 06:37:14 +01:00
|
|
|
def run
|
2023-08-11 16:15:17 +01:00
|
|
|
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}"
|
2023-07-19 15:14:28 +01:00
|
|
|
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__
|