mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2025-05-16 22:10:24 +01:00
example in readme and main.rb refactored
code style badge changed to standard
This commit is contained in:
parent
73ae24eb4b
commit
5f08b97759
15
README.md
15
README.md
@ -1,6 +1,6 @@
|
||||
[](https://badge.fury.io/rb/obsws)
|
||||
[](https://github.com/onyx-and-iris/obsws-ruby/blob/dev/LICENSE)
|
||||
[](https://github.com/prettier/plugin-ruby)
|
||||
[](https://github.com/standardrb/standard)
|
||||
|
||||
# A Ruby wrapper around OBS Studio WebSocket v5.0
|
||||
|
||||
@ -34,16 +34,11 @@ pass `host`, `port` and `password` as keyword arguments.
|
||||
require "obsws"
|
||||
|
||||
def main
|
||||
r_client =
|
||||
OBSWS::Requests::Client.new(
|
||||
host: "localhost",
|
||||
port: 4455,
|
||||
password: "strongpassword"
|
||||
)
|
||||
|
||||
r_client.run do
|
||||
OBSWS::Requests::Client
|
||||
.new(host: "localhost", port: 4455, password: "strongpassword")
|
||||
.run do |client|
|
||||
# Toggle the mute state of your Mic input
|
||||
r_client.toggle_input_mute("Mic/Aux")
|
||||
client.toggle_input_mute("Mic/Aux")
|
||||
end
|
||||
end
|
||||
|
||||
|
7
main.rb
7
main.rb
@ -1,16 +1,13 @@
|
||||
require_relative "lib/obsws"
|
||||
|
||||
def main
|
||||
r_client =
|
||||
OBSWS::Requests::Client.new(
|
||||
host: "localhost",
|
||||
port: 4455,
|
||||
password: "strongpassword"
|
||||
)
|
||||
|
||||
r_client.run do
|
||||
).run do |client|
|
||||
# Toggle the mute state of your Mic input
|
||||
r_client.toggle_input_mute("Mic/Aux")
|
||||
client.toggle_input_mute("Mic/Aux")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user